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

  • SEARCH
  • Home
  • 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 7909813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T12:36:33+00:00 2026-06-03T12:36:33+00:00

I have a set of pages acting as a slideshow where different elements are

  • 0

I have a set of pages acting as a slideshow where different elements are timed to be displayed as a recorded voice-over reads the text.

I’m running into trouble when I use load() to refresh the area with the next “slide”. I’m using setTimeout to control the display. My problem is that the 2nd page is using the setTimeout timings found in the first page. Do I need to clearTimeout?

Page 1 script:

var actions = [
  { time : 4, action : function() { $('#slidePhoto').animate({width: $('#slidePhoto img').width() / 1.5}, 2000 ).addClass('side-photo') } },
  { time : 8, action : function() { $('#slideEl2').fadeIn('slow') } },
  { time : 17, action : function() { $('#slideEl3').fadeIn('slow') } },
  { time : 24, action : function() { $('#slide-container').hide('slide', { direction: "left"}, 1000, function () {
      $('#slide-container').load('introduction2.php', function() {
        $('#slide-container').fadeIn('slow');
      });
    } ) } }
];
$(document).ready(function() {
  for( var i in actions ) {
    setTimeout( actions[i].action, actions[i].time * 1000 );
  }
});

Page 2 script:

var actions = [
  { time : 10, action : function() { $('#slidePhoto').animate({width: $('#slidePhoto img').width() / 1.5}, 2000 ).addClass('side-photo') } },
  { time : 16, action : function() { $('#slideEl2').fadeIn('slow') } },
  { time : 29, action : function() { $('#slideEl3').fadeIn('slow') } },
  { time : 40, action : function() { $('#slide-container').hide('slide', { direction: "left"}, 1000, function () {
      $('#slide-container').load('introduction3.php', function() {
        $('#slide-container').fadeIn('slow');
      });
    } ) } }
];
$(document).ready(function() {
  for( var i in actions ) {
    setTimeout( actions[i].action, actions[i].time * 1000 );
  }
});

The pages are loaded within an area on a main container page. I believe I could get around this by using different IDs on every single page, but I’m guessing there’s something much easier.

  • 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-03T12:36:35+00:00Added an answer on June 3, 2026 at 12:36 pm

    You need to register the timer id which is used as argument of the clearTimeout function.

    For example when creating the timeouts :

    for( var i=0; i<actions.length; i++ ) {
        actions[i].timeout = setTimeout( actions[i].action, actions[i].time * 1000 );
    }
    

    And then to clear them :

    for( var i=0; i<actions.length; i++ ) {
        clearTimeout(actions[i].timeout);
    }
    

    (I replaced your “for var i in” by a standard iteration on actions length, it’s the best practice for arrays)

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

Sidebar

Related Questions

I'm building a set of pages where I have a number of GET variables
I have the pages that I want to set as a goal in Google
I have a fairly complex set of rewrite rules to give my site pages
I have some pages set up so that they respond only to ajax requests.
I have a set of aspx pages that each live in their own directory
i have a set of web pages specifically designed to run on iPhones (using
I have a set of aspx pages which are made of up usercontrols. Each
I have set up sweepers to clear specific pages in the page cache when
I have a set of product pages that obey the following htaccess rule: RewriteCond
I have a large set of classic ASP pages to convert. I will be

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.