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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:02:54+00:00 2026-05-27T01:02:54+00:00

Possible Duplicate: Do something every 5 seconds and the code to stop it. (JQuery)

  • 0

Possible Duplicate:
Do something every 5 seconds and the code to stop it. (JQuery)

I have a gallery that i want to automatically run without me using it.

How can i run a script that calls this every 5 seconds or so on this http://www.meadmiracle.com/SlidingGalleryDemo1.htm

I need this to be called every 5 seconds or so bsaically so the gallery looks like it automatically scrolls.

$.galleryUtility.slideLeft( ) 
  • 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-27T01:02:55+00:00Added an answer on May 27, 2026 at 1:02 am

    You need to use the setInterval method

    <script type="text/javascript">
        $(window).load(function(){
            setInterval( function(){
                $.galleryUtility.slideLeft() ;
            }, 5000);
        });
    </script>
    

    Update

    In your specific case, you should add it right after you initialize the gallery.

    <script language="javascript" type="text/javascript">
        $(function() {
            $('div.gallery img').slidingGallery(); // add it right after this line of you existing code
            setInterval( function(){
                $.galleryUtility.slideLeft() ;
            }, 5000);
        });
    </script>
    

    Update 2

    To start stop the autoslide you will need to clear the interval, and to do so you need a reference to the returned value from the setInterval call.

    <script type="text/javascript">
        var autoSlideInterval;
    
        function start_autoslide(){
            autoSlideInterval = setInterval( function(){
                $.galleryUtility.slideLeft() ;
            }, 5000);
        }
    
        function stop_autoslide(){
            clearInterval( autoSlideInterval );
        }
    
        $(function() {
            $('div.gallery img').slidingGallery(); 
            start_autoslide();
        });
    
    </script>
    

    now when you want to star the auto-slide you call start_autoslide(); and when you need to stop it you call stop_autoslide();

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

Sidebar

Related Questions

Possible Duplicate: How to loop a css background image with Jquery every few seconds?
Possible Duplicate: jQuery select based on text I have something like this: <span>abc</span> <span>a</span>
Possible Duplicate: stripping out all characters from a string, leaving numbers I have something
Possible Duplicate: WHERE Something IN (CASE WHEN statement) ??!! i want ro write a
Possible Duplicate: Is there something wrong with joins that don't use the JOIN keyword
Possible Duplicate: Properties vs Methods For many situations it is obvious whether something should
Possible Duplicate: Puzzling Enumerable.Cast InvalidCastException Hi, I just noticed something quite strange with the
Possible Duplicate: How does the Google Did you mean? Algorithm work? Suppose you have
Possible Duplicate: Python timer countdown Hi guys, I want to know about timer in
Possible Duplicates: Things in .NET Framework 4 that every programmer should know Basic difference

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.