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 6616029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:32:03+00:00 2026-05-25T20:32:03+00:00

i managed to get a simple slideshow working that has two main features: automatically

  • 0

i managed to get a simple slideshow working that has two main “features”:

  • automatically sliding to the next image

  • showing the desired image on clicking the according indicator

the interval is set to display the next image after 5 seconds. however, when i choose a specific image by clicking its indicator, this timer should be reset so i can display the desired image for 5 seconds before the next image is shown. right now the timer is not reset and it might happen that i can only look at the image for a very short time… so far i have the following:

$('#keyvisualslides li:first-child').show();
$('#keyvisualpager li:first-child a').addClass('keyvisualactive');


var reload = setInterval(function(){
    // get position of a element
    var mbr_total = $('#keyvisualpager li a').length;
    var mbr_index = $('#keyvisualpager li .keyvisualactive').parent().prevAll().length;
    var mbr_targetkeyvisual = mbr_index + 2;

    if (mbr_targetkeyvisual > mbr_total) {
        mbr_targetkeyvisual = 1;
    }

    // hide current image and show the target image
    $('#keyvisualslides li:visible').hide();        
    $('#keyvisualslides li:nth-child('+mbr_targetkeyvisual+')').show();

    // remove active class from current indicator and add the same class to target indicator
    $('#keyvisualpager li a').removeClass('keyvisualactive');
    $('#keyvisualpager li:nth-child('+mbr_targetkeyvisual+') a').addClass('keyvisualactive');

}, 5000);


$('#keyvisualpager li a').click(function () { 

    var mbr_index = $(this).parent().prevAll().length;
    var mbr_targetkeyvisual = mbr_index + 1;

    $('#keyvisualslides li:visible').hide();        
    $('#keyvisualslides li:nth-child('+mbr_targetkeyvisual+')').show()

    $('#keyvisualpager li a').removeClass('keyvisualactive');
    $('#keyvisualpager li:nth-child('+mbr_targetkeyvisual+') a').addClass('keyvisualactive');

    //          
    // from now on wait 5 seconds until next image is automatically displayed
    // 

});

btw: i have to use jquery 1.2.1, no other version possible.

thanks a lot

  • 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-05-25T20:32:03+00:00Added an answer on May 25, 2026 at 8:32 pm
    $('#keyvisualslides li:first-child').show();
    $('#keyvisualpager li:first-child a').addClass('keyvisualactive');
    
    function showNextImage(){
        // get position of a element
        var mbr_total = $('#keyvisualpager li a').length;
        var mbr_index = $('#keyvisualpager li .keyvisualactive').parent().prevAll().length;
        var mbr_targetkeyvisual = mbr_index + 2;
    
        if (mbr_targetkeyvisual > mbr_total) {
            mbr_targetkeyvisual = 1;
        }
    
        // hide current image and show the target image
        $('#keyvisualslides li:visible').hide();        
        $('#keyvisualslides li:nth-child('+mbr_targetkeyvisual+')').show();
    
        // remove active class from current indicator and add the same class to target indicator
        $('#keyvisualpager li a').removeClass('keyvisualactive');
        $('#keyvisualpager li:nth-child('+mbr_targetkeyvisual+') a').addClass('keyvisualactive');
    
    }
    
    var reload = setInterval(showNextImage, 5000);
    
    
    $('#keyvisualpager li a').click(function () { 
        clearInterval(reload);
    
        var mbr_index = $(this).parent().prevAll().length;
        var mbr_targetkeyvisual = mbr_index + 1;
    
        $('#keyvisualslides li:visible').hide();        
        $('#keyvisualslides li:nth-child('+mbr_targetkeyvisual+')').show()
    
        $('#keyvisualpager li a').removeClass('keyvisualactive');
        $('#keyvisualpager li:nth-child('+mbr_targetkeyvisual+') a').addClass('keyvisualactive');
    
        reload = setInterval(showNextImage, 5000);
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone managed to get subsonic or a variant working on Windows Mobile? We
i've managed to get a simple animation working so when I roll over my
I am trying to create a simple image slideshow that fades in and out
I'm trying to get a simple mixture between Managed C++ and plain C++ working.
I managed to get the YUI calendar widget working fine. But When it displays
I am trying to get a simple effect working in jQuery, and only have
I'm crating a simple MVC app that has People and Notes tables. Using the
I've managed to get input hooks working, but now I'm kinda lost with putting
Thanks to StackOverflow, I managed to get the following code working perfectly, but I
I am trying to get a simple example of the Quartz scheduler working in

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.