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

The Archive Base Latest Questions

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

I have a script that loads content using load() via a click function. I’d

  • 0

I have a script that loads content using load() via a click function.

I’d like to change this to auto load content every one minute like a slideshow.

I have 3 videos I need to loop through.

Please can someone point me in the right direction I have no idea where to start. My current script is below.

Thanks

I have updated the code below, in accordance with elliot-bonneville answer. I still need to find a way to loop through these videos.

JS

// define var video
var video = $('div.video');
var linkOne = $('.video_1').attr('href');
var linkTwo = $('.video_2').attr('href');
var linkThree = $('.video_3').attr('href');

setInterval(function() {
// load content into video
video.load( linkTwo + ' .content' , function() {
    // remove loading text
    $('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute

setInterval(function() {
// load content into video
video.load( linkThree + ' .content' , function() {
    // remove loading text
    $('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute

setInterval(function() {
// load content into video
video.load( linkOne + ' .content' , function() {
    // remove loading text
    $('.load').remove();
});
}, 10000) // 60000 milliseconds = one minute
  • 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-03T23:04:35+00:00Added an answer on June 3, 2026 at 11:04 pm

    Use setTimeout

    I think something like the below. I haven’t tested it yet, so there might be some syntax errors. But hopefully you understand. let me know if anything doesn’t make sense.

    One reason I am using setTimeout rather setInterval is that this way, another timer doesn’t get fired until after the load has completed. In this case, it won’t matter too much as you are only doing it every 1 minute, but in some cases, the server latency might be more then the interval time. Also, this way, if for whatever reason, the script/server goes down and a successful reply isn’t received then another call won’t be made.

    // define var video
    var video = $('div.video');
    var currentVid=1;
    var maxVid=3;
    
    setTimeout(cycleVideo, 10000) // 60000 milliseconds = one minute
    
    function cycleVideo() {
        // load content into video
        var link = $('.video_'+currentVid).attr('href');
        video.load( link + ' .content' , function() {
            // remove loading text
            $('.load').remove();
            if(currentVid==maxVid) currentVid=1; else currentVid++;
            setTimeout(cycleVideo, , 10000) // 60000 milliseconds = one minute
    
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed a Wordpress site that loads pages dynamically using the .load function.
I have a script that loads big images into the body in this fashion
I have a script that drops a load of tables using DROP TABLE IF
I have a script on jquery that load some site in iframe using: $(#demo_frame).attr('src',
I have a java script function that i have called on body load mousemove()
I have a script which loads content into a iframe using: document.GetElementById('iframeid').src = 'site.html';
I have a script that dynamically loads iframes inside a webpage. You can see
I have a matlab script, lets call it master.m, that loads a file called
I have created an R script that it needs to load some libraries first.
I am hoping that someone can help me. I have found this jquery script

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.