简体   繁体   中英

jQuery News Ticker - not quite smooth enough

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(); }
            );

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

  1. http://remysharp.com/demo/marquee.html
  2. http://www.givainc.com/labs/marquee_jquery_plugin.htm
  3. http://www.vegabit.com/jquery_scroller/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM