zoukankan      html  css  js  c++  java
  • js文字滚动

     
    <style type="text/css"> 
    #gongao{1000px;height:30px;overflow:hidden;line-height:30px;font-size:13px;font-family:'宋体';background:#DDE5ED;color:#0C77CF;font-weight:bold;} 
    #gongao #scroll_begin, #gongao #scroll_end{display:inline} 
    </style> 
    <script type="text/javascript"> 
    function ScrollImgLeft(){ 
    var speed=50; 
    var scroll_begin = document.getElementById("scroll_begin"); 
    var scroll_end = document.getElementById("scroll_end"); 
    var scroll_div = document.getElementById("scroll_div"); 
    scroll_end.innerHTML=scroll_begin.innerHTML; 
    function Marquee(){ 
    if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0) 
    scroll_div.scrollLeft-=scroll_begin.offsetWidth; 
    else 
    scroll_div.scrollLeft++; 
    var MyMar=setInterval(Marquee,speed); 
    scroll_div.onmouseover=function() {clearInterval(MyMar);} 
    scroll_div.onmouseout=function() {MyMar=setInterval(Marquee,speed);} 
    </script> 
    <div id="gongao"> 
    <div style="900px;height:30px;margin:0 auto;white-space: nowrap;overflow:hidden;" id="scroll_div" class="scroll_div"> 
    <div id="scroll_begin"> 
    <a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a><a>${affiche.content}</a>
    </div> 
    <div id="scroll_end"></div> 
    </div> 
    <script type="text/javascript">ScrollImgLeft();</script> 
    </div> 
  • 相关阅读:
    UINavigation Controller
    多表连接原理
    关于内存管理
    UITabBar Contoller
    网站优化HTTP应用
    网站优化ASP.net页面跳转方式优化
    网站优化缓存访问的改进
    马化腾关于产品设计与用户体验的培训(转)
    聚聚呀平台系统结构图
    网站产品支付
  • 原文地址:https://www.cnblogs.com/superMay/p/5028951.html
Copyright © 2011-2022 走看看