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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:52:25+00:00 2026-06-06T13:52:25+00:00

I created an image fading slideshow reading this article . The code looks like

  • 0

I created an image fading slideshow reading this article.
The code looks like this:

$(document).ready(function() {
    $('#iPhoneExample img:gt(0)').hide();
    setInterval(function() {
        $('#iPhoneExample :first-child').fadeOut(1000)
        .next('img').fadeIn(1000)
        .end().appendTo('#iPhoneExample');
    }, 3000);
});

and this is the HTML and CSS:

<div id="iPhoneExample">
<img src="photo1.png" alt="" />
<img src="photo2.png" alt="" />
<img src="photo3.png" alt="" />
<img src="photo4.png" alt="" />
<img src="photo5.png" alt="" />
<img src="photo6.png" alt="" />
</div>

#iPhoneExample {
    width:305px;
    height:597px;
    background:url('immagini/iphoneBg.png') center no-repeat;
    position:relative;
    margin:0px 20px 0px 94px;
}
#iPhoneExample img {
    position:absolute;
    top:106px;
    right:22px;
    bottom:104px;
    left:25px;
}

Now I want to do this. When the page loads, the slideshow starts but I have 6 links, one for each image that I want to use to show the corresponding image… For example the slideshow starts and shows photo3 but if I click on photo5 link, the slideshow must show photo5 and then continue to photo6 etc.

I believe I should use the .click function but I don’t know what to write inside it. I’m a newbie with jQuery.

Thank you so much for your help!

  • 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-06T13:52:26+00:00Added an answer on June 6, 2026 at 1:52 pm
    <html>
    <head>
    <style>
    div { width: 850px; height: 350px; background: green; }
    </style>
    <script type = "text/javascript" src = "jquery.js"></script>
    <script type = "text/javascript" />
    $(function() {
    arr = ['photo1.jpg','photo2.jpg','photo3.jpg','photo4.jpg','photo5.jpg','photo6.jpg'];
    $("#iPhoneExample").append("<img src = '"+arr[0]+"' />");
    timer = setInterval(function() {
    var curnum = parseInt(($("#iPhoneExample").find("img").attr("src").match(/\d/g))[0]);
    var nextnum = curnum > 5 ? 0 : curnum;
    $("#iPhoneExample img").replaceWith("<img src = '"+arr[nextnum]+"' />");
    },3000);
    $("a").click(function(e) {
      if ($("a").filter(function() { return $(this).hasClass("clicked"); }).length)
        {
          clearInterval(newtimer);
        }
      else {
            $("a:first").addClass('clicked');
           }    
      e.preventDefault();
      var curnum = parseInt(($(this).attr("href").match(/\d/g))[0]);
      nextnum = curnum-1;
      clearInterval(timer);
      $("#iPhoneExample").html("<img src = '"+arr[curnum-1]+"' />");
      newtimer = setInterval(function() {
      nextnum = nextnum + 1 > 5 ? 0 : nextnum + 1;
      $("#iPhoneExample").html("<img src = '"+arr[nextnum]+"' />");
      },3000);
      });
    
    });
    </script>
    </head>
    <body>
    <div id = "iPhoneExample"></div>
    <a href = "www.photo1.html">Photo1</a>
    <a href = "www.photo2.html">Photo2</a>
    <a href = "www.photo3.html">Photo3</a>
    <a href = "www.photo4.html">Photo4</a>
    <a href = "www.photo5.html">Photo5</a>
    <a href = "www.photo6.html">Photo6</a>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having trouble working grabbing a dynamically created image from this service: http://opsin.ch.cam.ac.uk/opsin/USER-STRUCTURE-TO-GENERATE.png Im
hi friend i created this method for image select it working proper but i
I need to create a fading background image that stretches to fill the browser.
I have problem with dynamically created image (JavaScript). I want to change the innerHTML
i have created one image but problem is that when i save image from
I have created jquery image slider and it is working good. However i have
I created an .png image from a video using ffmpeg tool and i want
I have created a XML image gallery, which displays text in between each slide.
I have created PHP GD image for captcha, file called image.php each time it
I'd like to create an effect in a site I’m building where an image

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.