www.webdeveloper.com
Results 1 to 8 of 8

Thread: Help with image rotation slide show

  1. #1
    Join Date
    Jun 2012
    Posts
    5

    Help with image rotation slide show

    Hello,

    I inherited taking over a site and the main page has a slide show of 4 images. It is freezing on the last image instead of looping. Can anyone help?

    Code:
    function rotateImages( imageList, imageInterval ){
      if( imageInterval == null ) {
        var imageInterval = 7000;
      }
      var myImageItem = imageList + "> li.imageItem";
      var fadeInTime = 500;
      var imageFadeTime = 2500;
      //var imageCount = $( myImageItem ).length;
      var imageCount = 4;
      var currentImage = 0;
      
      // set up first item
      $( myImageItem ).eq(currentImage).fadeIn(imageFadeTime);
      
      
      // loop through images
      var theBigLoop = setInterval( function() {
        $( myImageItem ).eq(currentImage).fadeOut(imageFadeTime);
        if( currentImage == imageCount ){
            currentImage = 0;
        } else { 
            currentImage++;
        }
        $( myImageItem ).eq(currentImage).fadeIn(imageFadeTime);
          }, imageInterval); // end of setInterval
      
    } // end of rotateImages
    The site is here: http://www.crunchpak.com

    thanks!

  2. #2
    Join Date
    Jun 2012
    Posts
    12
    Your problem is in here.

    // loop through images
    var theBigLoop = setInterval( function() {
    $( myImageItem ).eq(currentImage).fadeOut(imageFadeTime);
    if( currentImage == imageCount ){
    currentImage = 0;
    FREE eBook
    Create Your First Website By 3:45 This Afternoon

  3. #3
    Join Date
    Jun 2012
    Posts
    5
    Any clue on how I can fix?

    thanks

  4. #4
    Join Date
    Jun 2012
    Posts
    5
    anyone?

  5. #5
    Join Date
    Jun 2012
    Posts
    12
    Try to change currentImage=1
    FREE eBook
    Create Your First Website By 3:45 This Afternoon

  6. #6
    Join Date
    Jun 2012
    Posts
    5
    Thank you for the response. I tried and it gets to the 4th image, stays a long time then cycles very quickly through the next image to the next. It's like it gets stuck and the other images pile up behind it?

  7. #7
    Join Date
    Jun 2012
    Posts
    5
    bump

  8. #8
    Join Date
    Jun 2012
    Posts
    12
    Here is a great forum you can find your question at.

    Warrior Forum
    FREE eBook
    Create Your First Website By 3:45 This Afternoon

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles