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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:53:54+00:00 2026-06-07T03:53:54+00:00

Okay so I have an image (id = slideshow) in my content section of

  • 0

Okay so I have an image (id = “slideshow”) in my content section of my site. I’m trying to create a loop that alternates the image src using JQuery. Here is the code I have so far. It seems to loop through but the only src change that it shows is the last one. As a result glossy.jpg is the only image I see. I know it must be working to some extent seeing as glossy.jpg is not the original src that I have set. Once I get each picture to show I’ll tidy up the rest of the code. Any answers are much appreciated =)

    $(document).ready(function() {

    for (i = 1; i <= 100; i++){
    $("#slideshow").attr("src", "Images/image1.jpg").fadeTo(3000, 1.00);
    $("#slideshow").fadeTo("slow", 0.00);
    $("#slideshow").attr("src", "Images/image2.jpg").fadeTo(3000, 1.00);
    $("#slideshow").fadeTo("slow", 0.00);
    $("#slideshow").attr("src", "Images/glossy1.jpg").fadeTo(3000, 1.00);
    $("#slideshow").fadeTo("slow", 0.00);
    }
    });
  • 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-07T03:53:56+00:00Added an answer on June 7, 2026 at 3:53 am

    Consider this code for an image rota tor that you are making.

    var images = new Array ('test1.png', 'test2.png', 'test3.png');
    var index = 1;
    
    function rotateImage()
    {
      $('#myImage').fadeOut('fast', function()
      {
        $(this).attr('src', images[index]);
    
        $(this).fadeIn('fast', function()
        {
          if (index == images.length-1)
          {
            index = 0;
          }
          else
          {
            index++;
          }
        });
      });
    }
    
    $(document).ready(function()
    {
      setInterval (rotateImage, 2500);
    });
    

    And this would be the HTML

    <div id="test">
      <img id="myImage" src="test1.png" alt="image test" />
      <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
    </div>
    

    Since you could utilize arrays while storing URL’s into them and then so the same rotation using setInterval() function.

    Referance : http://www.burnmind.com

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

Sidebar

Related Questions

Okay I have a small app for uploading an image (using phonegap, Jquery). I
i have a HyperLink on my site that is displaying an image instead of
OKAY! Here's the situation. I've got a jQuery plugin that's animating a background-image in
Okay, so I have a code, that take an image of the current view,
Okay, So I have a PHP file that uploads a image to my server.
okay i have found the way to run a video in a image.... the
okay i have been trying to understand this for hours i am learning VB
Okay I have a large CRUD app that uses tabs with Forms embedded in
I have the following image ontop of an image that is exactly 424x318 And
okay so i have a log in button on the top of my site

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.