zoukankan      html  css  js  c++  java
  • 飘扬的旗帜

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>飘扬的旗帜</title>
    <style>
    .container {
    400px;
    height: 280px;
    margin: 100px auto;
    background: url(https://cdn.files.qdfuns.com/article/cover/201803/06/090248oe1senkb1razeenk.png) no-repeat 0px 0px;
    overflow: hidden;
    position: relative;
    }
    .img {
    90px;
    position: absolute;
    top: 14%;
    left: 14%;
    }
    </style>
    </head>
    <body>
    <div class="container">
    <img class="img" src="https://cdn.files.qdfuns.com/article/content/picture/201803/06/090015vzevheuk18lrxs81.png" title="随风飘扬">
    </div>
    <script>
    var position = 0;
    var container = document.getElementsByClassName('container')[0];
    function positionn(k){
    setInterval(function(){
    k-=400;
    if(k==-18000){
    k=0;
    return k;
    }
    container.style.backgroundPosition = k+"px"
    },100)

    }
    positionn(position);
    </script>
    </body>
    </html>

    分享文章如有侵权,版权等问题,请私信联系我,我将第一时间删除或修正。
  • 相关阅读:
    python中字典一键多相同值反转技巧
    win10下安装mysql
    上台阶问题的具体走法用python来实现
    桥接模式
    适配器模式
    多线程中lock的使用
    原型模式
    多线程
    建造者模式
    代理模式
  • 原文地址:https://www.cnblogs.com/mhtss/p/8521717.html
Copyright © 2011-2022 走看看