【问题标题】:jquery continuous horizontal scroll not workingjquery连续水平滚动不起作用
【发布时间】:2015-03-03 12:46:15
【问题描述】:

我希望 div 中的内容连续水平滚动,但它不起作用。任何帮助将不胜感激

<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>

【问题讨论】:

    标签: jquery horizontal-scrolling


    【解决方案1】:

    使用这个Demo Here

    你可以简单地使用marquee

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

    【讨论】:

    • en.wikipedia.org/wiki/Marquee_element : "marquee 标签是一个非标准的 HTML 元素 [...] W3C 建议不要在 HTML 文档中使用它。"
    • @coding-cracker 是否可以让我知道我上面的 jquery 代码中的错误?谢谢
    猜你喜欢
    • 2017-01-07
    • 2013-06-29
    • 2012-08-13
    • 1970-01-01
    • 2013-11-11
    • 2019-01-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多