最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery News Ticker - not quite smooth enough - Stack Overflow

programmeradmin2浏览0评论

Hey, I have a nice news ticker that stops on mouseover etc... but the animation is slightly jerky - any ideas?

var ticker_holder = $('#ticker').get(0);
            var ticker_text = $('#ticker').get(0);
            var ticker_pos = ticker_text.parentNode.offsetWidth;

            var ticker_data = "<strong>Featured: </strong>"
            +"HardCoded, DamnCool, AliveKicking, NinjaGaiden, WikiWord, FeaturedWords...";
            $(ticker_text).html('<marquee scrollamount="1" scrolldelay="20">' + ticker_data + '</marquee>');

            $('#ticker').hover(
                function() { $('marquee', this).get(0).stop();  },
                function() { $('marquee', this).get(0).start(); }
            );

Hey, I have a nice news ticker that stops on mouseover etc... but the animation is slightly jerky - any ideas?

var ticker_holder = $('#ticker').get(0);
            var ticker_text = $('#ticker').get(0);
            var ticker_pos = ticker_text.parentNode.offsetWidth;

            var ticker_data = "<strong>Featured: </strong>"
            +"HardCoded, DamnCool, AliveKicking, NinjaGaiden, WikiWord, FeaturedWords...";
            $(ticker_text).html('<marquee scrollamount="1" scrolldelay="20">' + ticker_data + '</marquee>');

            $('#ticker').hover(
                function() { $('marquee', this).get(0).stop();  },
                function() { $('marquee', this).get(0).start(); }
            );
Share Improve this question asked Feb 7, 2011 at 14:57 Barrie ReaderBarrie Reader 10.7k11 gold badges77 silver badges141 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Marquee is not remended tag. Is is nod defined in stadard, avoid using it. Try one of theese plugins:

  1. http://remysharp./demo/marquee.html
  2. http://www.givainc./labs/marquee_jquery_plugin.htm
  3. http://www.vegabit./jquery_scroller/
发布评论

评论列表(0)

  1. 暂无评论