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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T21:24:53+00:00 2026-05-13T21:24:53+00:00

I have this code to run a slideshow (this is only part of what

  • 0

I have this code to run a slideshow (this is only part of what really going in my code)

var slideshow = {
        delay: 5000,
        actions:[],
        run: function() {
                if (slideshow.actions.length) {
                        slideshow.actions.shift()();
                        setTimeout(slideshow.run, slideshow.delay);
                }
        }
};
 var tn;
$(".sideimg").each(function(){
        var that = this;

        slideshow.actions.push(function(){
 if (tn != "") {
  out(tn);
 }
 over($(that).attr("id"));
 var $paneTarget = $('#lyr1');

 var $target = $paneTarget.find('#'+$(that).attr("id"));
 $paneTarget.stop().scrollTo( $target , 800 );

 $("#rimg").fadeOut("slow",function () {
 $("#rimg").attr("src",$(that).attr("bsrc")); 
 $("#rimg").attr("alt",$(that).attr("alt")); 
   $("#rimg").fadeIn("normal");
  });
 tn = $(that).attr("id");

        });

});

after finishing running each sideimg class it stops… i need to re start from the beggining…
i have tried to recall it – but nothing happend

thanks guys

  • 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-13T21:24:53+00:00Added an answer on May 13, 2026 at 9:24 pm

    For this situation, I wouldn’t use the each method at all. I’d use setTimeout, an array of object that have your image/href information, and a value that tells you where in the array of images you are. When you get to the end of the array, reset the value (the following code is simplified for clarity, and not tested):

    var index = 0;
    var images = // array of image containing objects here. 
    
    function RunSlideShow()
    {
         // modify the following line to perform any effects, etc, and other attribute settings you need. 
         $("#rimg").attr("src", images[index].image);
    
         index = index + 1;
         if (index = images.length)
             index = 0;
         window.setTimeout('RunSlideShow();', 5000);
    }
    
    RunSlideShow();
    

    Each time the function in your slideshow object is called, you really need to have that function load the next slide before it exits. The issue with having each reloop when it’s done, is the question: “When does it stop?” If you pre-load all the images, to continue forever, you’ll cause an infinite loop and more than likely crash the browser. You need the same function to set the image, then prepare the next image to be shown, but it should look no further in the future than the next image. Anytime you try to go beyond that, you’re at risk of creating an ever-growing collection of items that will never stop.

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

Sidebar

Related Questions

No related questions found

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.