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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:49:16+00:00 2026-05-31T15:49:16+00:00

I have to create a automatic slideshow with images, I would like to put

  • 0

I have to create a automatic slideshow with images, I would like to put every image in a different position into the body tag, so I have created one div for every image.
I’m using jQuery each() to show all the images

<div id="img1" class="images" ><img  src="img/works/img1.jpg"/></div>
<div id="img2" class="images" ><img src="img/works/img2.jpg"/></div>
...


<script>
var arr = ["img1", "img2",..., "img22" ];

var $fade_in=1500;

$.each(arr, function images(i) {
$("#" + this).delay(i*1000).show($fade_in);
});     
</script>

It works. Now, how can I obtain the function recursive? I need a infinite loop

I have seen those links,
http://jsfiddle.net/maniator/F6nJu/1/
http://jsfiddle.net/JJfKM/138/
but I can’t apply they in my code.

Sorry for my english.

  • 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-31T15:49:18+00:00Added an answer on May 31, 2026 at 3:49 pm

    You can use setInterval() to repeatedly run the slides forever.

    function runSlides() {
        var index = 0;
        var imgList$ = $(".images");
    
        setInterval(function () {
            // hide previous slide
            imgList$.eq(index).hide(1500);
            // show next slide
            ++index;
            if (index >= imgList$.length) {
                index = 0;
            }
            imgList$.eq(index).show(1500);
        }, 2500);    
    }
    

    And, the at some point in your code, you would call this by using:

    runSlides();
    

    In this example, I’ve hidden the previous slide and shown the next one on each interval which isn’t something you did in your example, but I figure you have to do something like that to get it to repeat over and over again.

    Working example here: http://jsfiddle.net/jfriend00/4STRU/.

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

Sidebar

Related Questions

I have a standard JTable with certain data inside. I would like to create
I would like to create an automatic Flowchart-like visualization to simple Java Logic, for
I'm using schemaExport to create an in-memory database for my automatic tests. I have
I'd like to create an enumeration for ACCESS_MASK i have to use with P/Invoke
If I create a foreign key is referential integrity automatic? Do I have to
I have to create an automatic weather including rain, snow, clouds, fog and sunny.
Xcode allows you to create automated scripts for performing repetitive tasks. What scripts have
I have create my own NSOpenGLView class, right now the data that i want
I have create name range on sheet A so I need to use this
i have create a form (so it's PHP and HTML hybrid-code). it has ability

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.