zoukankan      html  css  js  c++  java
  • css广告弹窗满屏跑

    window.onload=function(){
            //广告滚动
            var oneInner = $('#divid')[0];
            //定时器
            var a1a = setInterval(moves,10);
            //函数 
            var x = 1;
            var y = 1;
            function moves(){
                var tops = oneInner.offsetTop
                var lefts = oneInner.offsetLeft
        
                if (lefts>=document.documentElement.clientWidth-oneInner.offsetWidth||lefts<0)
                {
                    x = -x;
                }
        
                if (tops>=(document.documentElement.clientHeight+document.documentElement.scrollTop)-oneInner.offsetHeight)
                {
                    y = -1;
                }
                if (tops<=document.documentElement.scrollTop){
                    y = 1;
                }
        
                tops+=y;
                lefts+=x;
        
                oneInner.style.top=tops+"px"
                oneInner.style.left=lefts+"px"
            }
            //悬停停止
            oneInner.onmouseover=function(){
                clearInterval(a1a);
            }
            //放手继续运动
            oneInner.onmouseout=function(){
                a1a =setInterval(moves,10);
            }
        }
  • 相关阅读:
    docker使用
    window版docker安装及配置
    mysql命令
    xshell
    git 命令
    分页器原理
    PCL-Kinfu编译手册
    cmake-add_definitions
    cmake-include_directories
    cmake-source_group
  • 原文地址:https://www.cnblogs.com/xiufengd/p/10654701.html
Copyright © 2011-2022 走看看