【问题标题】:How to make adaptive background image increase and returns to its original size constantly? [closed]如何使自适应背景图像不断增加并恢复到原来的大小? [关闭]
【发布时间】:2015-01-29 21:07:02
【问题描述】:

我需要将 jpg 中的页面背景图像设置为动画 - 我找到了一种解决方案来不断平滑地增加图像,然后在不缩小的情况下恢复到它的真实大小。无悬停 - 无需用户进行任何活动即可自动进行。

请帮忙:)

【问题讨论】:

    标签: jquery html css


    【解决方案1】:

    试试这个,你可以用css做到这一点Fiddle

    .bg {
        width:200px;
        background:url('http://placekitten.com/300/301');
        height:200px;
        background-size:100%;
        -webkit-animation:lar 5s infinite;
    }
    @-webkit-keyframes lar {
        0% {
            background-size:100%;
        }
        50% {
            background-size:200%;
        }
        100% {
            background-size:100%;
        }
    }
    }
    <div class="bg"></div>

    【讨论】:

    • @Danko 好的,谢谢你的建议我应该删除我的答案吗?
    • @Akshay 谢谢!不需要删除 - 我会积极回答其他人:)
    猜你喜欢
    • 2018-06-23
    • 2015-12-07
    • 2015-11-04
    • 2011-04-17
    • 2015-07-30
    • 1970-01-01
    • 2021-09-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多