Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8449419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:42:05+00:00 2026-06-10T10:42:05+00:00

I have a sideshow using jQuery Cycle . The way it works is that

  • 0

I have a sideshow using jQuery Cycle. The way it works is that clicking the .next or .prev divs cycles through the slideshow as expected. What I need it to do though is to have it update the UL in .timeline_pagination and add/remove the class ‘active’ to the corresponding slide. eg. if the #tl_2004 slide is active, the then #goto2004 li needs the class active. I do not want or need the #goto*** to be functional, they’re purely there as a display reference.

Thanks for your help in advance.

Here is the markup:

<!-- FAKE PAGINATION -->    
<div class="timeline_pagination">
        <ul>
            <li class="active" id="goto1994">1994</li>
            <li id="goto2000">2000</li>
            <li id="goto2004">2004</li>
            <li id="goto2007">2007</li>
        </ul>
</div>
<!-- END FAKE PAGINATION --> 

<div class="timeline_slideshow">
    <div class="prev"></div>
    <div class="next"></div>
    <div class="tl_slideshow">

        <div id="tl_1994">
            <div class="caption">
                <h4>title</h4>
                <p>my text</p>
            </div>
        </div>

        <div id="tl_2000">
            <div class="caption">
                <h4>title</h4>
                <p>my text</p>
            </div>
        </div>

        <div id="tl_2004">
            <div class="caption">   
                <h4>title</h4>
                <p>my text</p>
            </div>
        </div>

        <div id="tl_2007">
            <div class="caption">
                <h4>title</h4>
                <p>my text</p>
            </div>
        </div>

    </div>
</div>

Here is the javascript:

$('.tl_slideshow').cycle({
        fx:         'scrollHorz',
        next:       '.next', 
        prev:       '.prev',
        timeout:    0,
        speed:      750,
        nowrap:     1,
        after:      onAfter
});

function onAfter(curr, next, opts) {
    var index = opts.currSlide;
    $('.prev')[index == 0 ? 'fadeOut' : 'fadeIn']();
    $('.next')[index == opts.slideCount - 1 ? 'fadeOut' : 'fadeIn']();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:42:06+00:00Added an answer on June 10, 2026 at 10:42 am

    Try with this jquery code

    var PREFIX_ID_PAGINATION = "goto";
    var PREFIX_ID_SLIDESHOW = "tl_";
    
    $('.tl_slideshow').cycle({
            fx:         'scrollHorz',
            next:       '.next',
            prev:       '.prev',
            timeout:    0,
            speed:      750,
            nowrap:     1,
            after:      onAfter
    });
    
    function onAfter(prev, current, opts) {
        var index = opts.currSlide;
        $('.prev')[index == 0 ? 'fadeOut' : 'fadeIn']();
        $('.next')[index == opts.slideCount - 1 ? 'fadeOut' : 'fadeIn']();
    
        var current_id = $(current).attr('id');
        if( current_id.match("^" + PREFIX_ID_SLIDESHOW + "[0-9]+$")){
            $('li.active').removeClass('active');
            $('#' + PREFIX_ID_PAGINATION + current_id.replace(PREFIX_ID_SLIDESHOW,"")).addClass('active');
        }
    }
    

    There is a jsfiddle example here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a slideshow widget, using jQuery.UI widgets that works with window.setInterval. I
I'm using the jQuery Cycle plugin to create an image slideshow. It works great,
I have some jQuery that creates a slideshow using BX slider for an unknown
I have implemented a slideshow using jquery cycle plugin : the problem with the
I am using the cycle jquery plugin. I have a few images that fade
I have a jQuery slideshow, I'm using the cycle plugin. I'm decent with jQuery,
I have made a simple image slideshow using jQuery. I need the next button
I have a slideshow component that I wrote in javascript using jQuery. The slideshow
I am creating my own carousel slideshow for images, using Jquery. Currently i have
I have been using a jquery slideshow, but when I include a jquery newsticker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.