跑马灯效果[ 图片,文字 ],鼠标悬停停止,鼠标移出继续

View Code
                <div id="demo" style="overflow: hidden; width:746px; color: #ffffff; height: 235px;">
                     <table border="0" cellpadding="0" cellspacing="0" class="line2" >
                       <tr>
                          <td style="height:2px">    
                          </td>
                       </tr>
                       <tr>
                          <td id="demo2" align="center"  style="height: 90px" valign="middle"  >
                          </td>
                          <td id="demo1" align="center" style="height: 90px" valign="middle">                                   
                            <table style="width:746px;height: 235px;">
                                <tr>
               <td>
               <img height="230px" width="230px" src="../images/award/230x230-1.jpg" style="border-style: none" />          
             </td>
               <td>
               <img height="230px" width="230px" src="../images/award/230x230-2.jpg" style="border-style: none" />          
             </td>
               <td>
               <img height="230px" width="230px" src="../images/award/230x230-3.jpg" style="border-style: none" />          
             </td>
               <td>
               <img height="230px" width="230px" src="../images/award/230x230-4.jpg" style="border-style: none" />          
             </td>
               <td>
               <img height="230px" width="230px" src="../images/award/230x230-5.jpg" style="border-style: none" />          
             </td>
             
              <td>
               <img height="230px" width="230px" src="../images/award/230x230-6.jpg" style="border-style: none" />          
             </td>
              <td>
               <img height="230px" width="230px" src="../images/award/230x230-7.jpg" style="border-style: none" />          
             </td>
              <td>
               <img height="230px" width="230px" src="../images/award/230x230-8.jpg" style="border-style: none" />          
             </td>
           </tr>      
                            </table>
                        </td>                                   
                      </tr>                                 
            </table>

                </div>

 

View Code
function test() {
            var speed = 10;
            demo2.innerHTML = demo1.innerHTML
            function Marquee() {
                if (demo2.offsetWidth - demo.scrollLeft <= 0)
                    demo.scrollLeft -= demo1.offsetWidth
                else {
                    demo.scrollLeft++
                }
            }
            var MyMar = setInterval(Marquee, speed)
            demo.onmouseover = function() { clearInterval(MyMar) }
            demo.onmouseout = function() { MyMar = setInterval(Marquee, speed) }
        }

 

 

转载于:https://www.cnblogs.com/JiangXiaoTian/articles/2550540.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值