Thursday, 1 November 2012

How to create a simple news ticker using jQuery


Very simple, easy to use news ticker created using jQuery with awesome animation effect. Adds much more effect and attraction to your website. It accommodates a lot of content in a small space. The same has been adopted by facebook to showcase the recent activity of friends. You will find the code comparatively easy to understand.


<div id="newsticker-container">

1) <a href="">Facebook type vertical navigation menu created using jQuery</a>

2) <a href="">facebook style activity notification</a>

3) <a href="">CSS jQuery Drop Down Menus</a>

4) <a href="">Facebook Style Alert Confirm Box using jQuery</a>

5) <a href="">facebook like red notification created using CSS only</a>

6) <a href=""> like top bar with drop down menu using CSS</a>

7) <a href="">Gmail type select all checkbox using jQuery</a>


The Javascript


$.fn.newsTicker = function(options) {

var defaults = {

speed: 700,

pause: 4000,

NoOfItems: 4,

isPaused: false,

height: 0


var options = $.extend(defaults, options);

var obj = $(this);

var maxHeight = 0;

obj.css({overflow: 'hidden', position: 'relative'})

 .children('ul').css({position: 'absolute', margin: 0, padding: 0})

 .children('li').css({margin: 0, padding: 0, cursor:'pointer'});

// Get the height if the list items

 maxHeight = obj.children('ul').children('li').height();

// Set the height of the newsticker

 obj.height(maxHeight * options.NoOfItems);

// The main function which executes the move-up animation

var interval = setInterval(function(){

  moveUp(obj, maxHeight, options);

}, options.pause);

// To activate mouse pause


  options.isPaused = true;


  options.isPaused = false;


moveUp = function(container, height, options){



var obj_ul = container.children('ul');

var copy_first = obj_ul.children('li:first').clone(true);

obj_ul.animate({top: '-=' + height + 'px'}, options.speed, function() {


 $(this).css('top', '0px');



if(options.height == 0)


obj_ul.children('li:eq(' + options.NoOfItems + ')').hide().fadeIn(options.speed).show();


copy_first.appendTo(obj_ul); // Copy the first element back to the main ul object





  1. An interesting discussion is definitely worth comment.

    I believe that you should write more about this subject matter, it may not be a taboo matter but usually
    people don't discuss such topics. To the next! Many thanks!!
    Also see my web site: Dir Print

    1. hi! you should also check how you can hack into someone's Facebook account here: Facebook password hacking

  2. Very nice post. I just stumbled upon yоur blog and wanted to say that I
    have really enjoyеd surfіng аround your blog pοѕts.
    In anу case I'll be subscribing to your feed and I hope you write again very soon!
    Also visit my webpage - product reviews

  3. I like the valuable info you provide in your articles.
    I'll bookmark your weblog and check again here frequently. I am quite sure I will learn many new stuff right here! Good luck for the next!
    Here is my web site : Facebook Page Entreprise

  4. Please let me know if you're looking for a author for your site. You have some really great articles and I feel I would be a good asset. If you ever want to take some of the load off, I'd love to write some content
    for your blog in exchange for a link back to mine.

    Please blast me an email if interested. Thank you!
    Stop by my weblog : investir maroc secteur

  5. I blog often and I truly thank you for your content.
    This great article has really peaked my interest.
    I am going to bookmark your site and keep checking
    for new details about once per week. I subscribed to your RSS feed too.
    My web site >

  6. I am really pleased to glance at this weblog posts which includes plenty of helpful facts, thanks for providing such data.
    Here is my web site :: sac Cadeau pas cher

  7. hello ,
    did you have noticed that there is a tick (jump) after line no 2?

  8. I've been browsing online more than three hours today, yet I never found any interesting article like yours. It's pretty worth enough for me.
    In my view, if all web owners and bloggers made good content as you did,
    the web will be much more useful than ever before.
    My website :: uk merchant cash advance

  9. Hmm it seems like your blog ate my first comment (it was extremely long)
    so I guess I'll just sum it up what I wrote and say, I'm thoroughly enjoying
    your blog. I too am an aspiring blog writer but I'm still new to the whole thing. Do you have any tips and hints for beginner blog writers? I'd definitely appreciate it.
    Also see my webpage > Oyunu

  10. Nice post. I learn something new and challenging on websites
    I stumbleupon everyday. It's always interesting to read articles from other writers and practice something from their sites.
    Also visit my web blog :: document

  11. Wow! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same page layout and design. Wonderful choice of colors!
    Feel free to visit my blog SEO Info

  12. Remarkable! Its truly awesome piece of writing, I have got much clear idea on the topic of from this piece of writing.
    Also see my page: games online

  13. Heya! I'm at work browsing your blog from my new iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts! Carry on the fantastic work!
    Feel free to visit my weblog :

  14. This comment has been removed by the author.

  15. This website was... how do you say it? Relevant!

    ! Finally I've found something that helped me. Many thanks!

    Feel free to visit my website :: vexxhost review sites

  16. Good post. I learn something totally new and challenging on blogs I stumbleupon
    everyday. It's always useful to read through articles from other writers and practice a little something from their websites.

    My web page: home business
    Also see my web site > home business system

  17. I found your site on and I'm so happy I did. It's like you read my mind.
    You appear to know so much concerning this, like you authored the book on it or something.

    While I think some extra media like some pics or a couple of
    videos, this will be a fantastic resource. I will
    certainly come back.

    My page: 38242

  18. Hello there, I just wanted to see if you ever have any
    trouble with hackers? My last blogspot blog at http:
    // was hacked and I wound
    up losing a few months of hard work due to no back up.
    Do you have any ideas to stop intrudersI must ask
    though, but where exactly did you obtain your blog style:
    did you see it elsewhere or did you make it personally?
    With a theme like the one you have, my blog could really stand out
    more. Kindly tell me the place where you got your look.

    Feel free to surf to my website - licence

  19. Excellent Tutorial on creating simple and clean code. do check my page for Facebook password hacking

  20. Find the Best packers and movers service provider in Pitampura. at the affordable price.

    Packers and movers in pitampura
    Packers and movers in rohini