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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:08:46+00:00 2026-05-16T05:08:46+00:00

(edit) It is supposed to rotate the fade between 3 images every 5 seconds.

  • 0

(edit)
It is supposed to rotate the fade between 3 images every 5 seconds. But rather it just fades the same one over and over every 5 seconds, never going to the next image. Here’s mote context because maybe the error wasn’t caused by anything in the initial post:

                $(".paging").show();  

                $(".paging a:first").addClass("active"); 

                $(".image_reel img:first").addClass("active");




                var imageWidth = $(".window").width();
                var imageSum = $(".image_reel div").size();  
                var imageReelWidth = imageWidth * imageSum;



                //Adjust the image reel to its new size
                $(".image_reel").css({'width' : imageReelWidth});  


                //Paging  and Slider Function
                rotate = function(){


                    var triggerID = $active.attr("rel") - 1; //Get number of times to slide
                    var image_reelPosition = triggerID * imageWidth; //Determines the distance the image reel needs to slide

                    $(".paging a").removeClass('active'); //Remove all active class

                    $active.addClass('active'); //Add active class (the $active is declared in the rotateSwitch function)

                    //Slider Animation
                    $(".image_reel").animate({
                        left: -image_reelPosition
                    }, 500 );

                    $(".image_text").animate({
                        left: -image_reelPosition
                    }, 500 );
                }; 
                //Below is part not working right
                fadeImg = function(){

                    $("#group1 img").removeClass('active'); 
                    $next.addClass('active');               

                    $("#group1 img").animate({
                        opacity: 0
                    }, 500 );

                    $next.animate({
                        opacity: 1
                    }, 500 );



                };

                //Rotation  and Timing Event
                rotateSwitch = function(){
                    play = setInterval(function(){ //Set timer - this will repeat itself every 7 seconds
                        $active = $('.paging a.active').next(); //Move to the next paging
                        if ( $active.length === 0) { //If paging reaches the end...
                            $active = $('.paging a:first'); //go back to first
                        }
                        rotate(); //Trigger the paging and slider function
                    }, 15000); //Timer speed in milliseconds (7 seconds)

                    playFade = setInterval(function(){ 

                        $next = $(".image_reel img.active").next();
                        if($next.length === 0){
                            $next = $(".image_reel img:first");
                        } 
                        fadeImg();
                    }, 5000);
                };

                rotateSwitch(); //Run function on launch

                //On Hover
                $(".image_reel a").hover(function() {
                    clearInterval(play); //Stop the rotation
                }, function() {
                    rotateSwitch(); //Resume rotation timer
                }); 

                //On Click
                $(".paging a").click(function() {
                    $active = $(this); //Activate the clicked paging
                    //Reset Timer
                    clearInterval(play); //Stop the rotation
                    rotate(); //Trigger rotation immediately
                    rotateSwitch(); // Resume rotation timer
                    return false; //Prevent browser jump to link anchor
                });

markup:

<div class="image_reel"> 
    <div id="group1">
        <a href="#"><img src="images/reel_1.png" class="first" /></a>  
        <a href="#"><img src="images/reel_1b.png" class="second" /></a>
        <a href="#"><img src="images/reel_1c.png" class="third" /></a>

        <p class="first">  A</p>
        <p class="second">  B</p>
        <p class="third">C</p>

        <div class="slidernav">
            <a href="#first"> A</a> 
            <a href="#second"> B</a> 
            <a href="#third"> C</a> 
        </div>
    </div>
</div>
​

Note that I am aware of plugins to create fade effects, but I’m trying to do it manually for now. Thanks for any response.

  • 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-16T05:08:46+00:00Added an answer on May 16, 2026 at 5:08 am

    The problem is that: $next = $(".image_reel img.active").next(); does not do what you are wanting it to do. What that is doing is finding img.active and then trying to find its next sibling, since it doesn’t have any siblings $next gets set to an empty jQuery object.

    What you want is something like this:

    $next = $(".image_reel img.active").parent().next().find('img');

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

Sidebar

Related Questions

I have a banner (XML_Banner.swf) that is supposed to load and rotate images from
I am supposed edit some code for an assignment, and he gave us the
I have a a4j:commandButton which is supposed to redirect me to an appropriate Edit
Is this supposed to work? When i use <xs:pattern value=(!red|green|blue)/> everything is fine, but
link to image The ordered list is supposed to look like this: link EDIT:
Edit: Added bounty because I'm seeking an MVC3 solution (if one exists) other than
EDIT: Apparently I was a little confusing. The original post will remain below, but
I'd like to use Oracle's utl_match.edit_distance function. It supposed to compare two strings and
EDIT: I suppose I should clarify, in case it matters. I am on a
Can you make file copying faster through multiple threading? Edit : To clarify, suppose

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.