2015-03-03 147 views
-1

我想我的div內的內容不斷滾動水平,它不工​​作。任何幫助將不勝感激jquery連續水平滾動不工作

<div id="mydivid">This text needs to be scrolled horizontally continuously</div> 
<script type="text/javascript"> 
    jQuery(document).ready(function() { 
     jQuery("#mydivid") 
      .stop() 
      .animate({ left: "-=100px" }, 2000); 
    }); 
</script> 

回答

1

使用此Demo Here

,你可以簡單地使用marquee

<div id="mydivid"><marquee>This text needs to be scrolled horizontally continuously</marquee></div> 
+0

http://en.wikipedia.org/wiki/Marquee_element:「*選框標籤一個非標準的HTML元素[W3C] W3C建議不要在HTML文檔中使用它。*「 – 2015-03-03 12:50:46

+0

@ coding-cracker是否有可能讓我知道我的上述jQuery代碼中的錯誤?謝謝 – Shanthi 2015-03-03 13:40:25