Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Multiple Fading Headlines with jQuery

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36451
    sly
    Participant

    Hi folks,

    I’m using this clever script from http://www.subchild.com/2008/08/02/creating-fading-headlines-in-5-minutes-with-jquery/

    But am unsure of how to have two different fading lists on the same page:

    $(document).ready(function(){
    $("#headlines li").hide();

    var headlineFadeSpeed = 5000;
    function showNextItem(){
    var index = arguments[0] || 1;
    var $curLi = $("#headlines li:nth-child("+index+")");
    var totalItems = $("#headlines li").length;

    $curLi.fadeIn("fast", function(){
    setTimeout(function(){
    $curLi.fadeOut("slow", function(){
    index = (index < totalItems) ? index+1 : 1;
    showNextItem(index);
    });
    }, headlineFadeSpeed);
    });
    }

    showNextItem();
    });

    Can anyone help?

    #96146
    soap
    Participant

    call it on a different element other than #headlines li?

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.