• 无缝滚动--水平方向


    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>图片跑马灯</title>
    </head>
    <body>
    <div id="colee_right" style="overflow:hidden;960px;margin:20px auto;">
    <table cellpadding="0" cellspacing="0" border="0">
    <tbody>
    <tr>
    <td id="colee_right1" valign="top" align="center">
    <table cellpadding="2" cellspacing="0" border="0">
    <tbody>
    <tr align="center">
    <td><a href="http://www.haier.com/cn/" target="_blank"><img src="images/haier_logo.png"></a></td>
    <td><a href="http://www.tongshuai.com/" target="_blank"><img src="images/ts_logo.png"></a></td>
    <td><a href="http://www.geeya.cn/" target="_blank"><img src="images/jykj_logo.png"></a></td>
    <td><a href="http://www.jiuzhou.com.cn/" target="_blank"><img src="images/jz_logo.png"></a></td>
    <td><a href="http://www.coupoint.net/" target="_blank"><img src="images/klc_logo.png"></a></td>
    <td><a href="http://shop.coolpad.cn/" target="_blank"><img src="images/kp_logo.png"></a></td>
    <td><a href="http://www.rapoo.cn/" target="_blank"><img src="images/lp_logo.png"></a></td>
    <td><a href="http://www.sumavision.com/" target="_blank"><img src="images/smsx_logo.png"></a></td>
    <td><a href=" http://www.lefant.com.cn/" target="_blank"><img src="images/lf_logo.png"></a></td>
    <td><a href=" http://www.yuandaocn.com/" target="_blank"><img src="images/yd_logo.png"></a></td>
    <td><a href="http://www.mobee.tv/" target="_blank"><img src="images/wpt_logo.png"></a></td>
    <td><a href="http://www.egreatworld.com/" target="_blank"><img src="images/ygr_logo.png"></a></td>
    </tr>
    </tbody>
    </table>
    </td>
    <td id="colee_right2" valign="top">
    </td>
    </tr>
    </tbody>
    </table>
    </div>
    <script type="text/javascript">

    var speed=3//速度数值越大速度越慢
    var colee_right2=document.getElementById("colee_right2");
    var colee_right1=document.getElementById("colee_right1");
    var colee_right=document.getElementById("colee_right");
    colee_right2.innerHTML=colee_right1.innerHTML;

    function Marquee4(){
    /*向左滚动*/
    if(colee_right2.offsetWidth-colee_right.scrollLeft<=0){
    colee_right.scrollLeft-=colee_right2.offsetWidth ;
    }else{
    colee_right.scrollLeft++;
    }

    /*向右滚动*/
    /*if(colee_right.scrollLeft<=0){
    colee_right.scrollLeft+=colee_right2.offsetWidth ;

    }else{

    colee_right.scrollLeft--;
    }*/


    }
    var MyMar4=setInterval(Marquee4,speed);
    colee_right.onmouseover=function(){
    clearInterval(MyMar4);
    }
    colee_right.onmouseout=function(){
    MyMar4=setInterval(Marquee4,speed);
    }

    </script>
    </body>
    </html>

  • 相关阅读:
    MyBatis3: There is no getter for property named 'code' in 'class java.lang.String'
    jQuery获取Select选择的Text和 Value(转)
    mybatis3 :insert返回插入的主键(selectKey)
    【转】Mybatis/Ibatis,数据库操作的返回值
    Android问题-打开DelphiXE8与DelphiXE10编译空工程提示“[Exec Error] The command exited with code 1.”
    Android问题-打开DelphiXE8与DelphiXE10新建一个空工程提示"out of memory"
    BAT-使用BAT生成快捷方式
    给 TTreeView 添加复选框
    跨进程发送消息数据
    鼠标拖动虚影效果
  • 原文地址:https://www.cnblogs.com/xiaotaiyang/p/3850241.html
Copyright © 2020-2023  润新知