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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:39:43+00:00 2026-06-13T22:39:43+00:00

maybe it has been solved somewhere on this website but I did not find

  • 0

maybe it has been solved somewhere on this website but I did not find the answer. Maybe this is because I am pretty new to jQuery and don’t really know what may cause the problem.

So I have this code that I add on my WordPress Website. I found the original code on this website and I tried to adjust it to my need.

(function(){

    var j = 0;
    var delay = 2200; //millisecond delay between cycles

    jQuery.fn.rotateImg = function() {
        var list = jQuery(this);
        function cycleThru() {
            var jmax = list.length -1;
            jQuery(list.selector + ":eq(" + j + ")")
                .animate({"opacity" : "1"} ,800)
                .animate({"opacity" : "1"}, delay)
                .animate({"opacity" : "0"}, 800, function(){
                    (j == jmax) ? j=0 : j++;
                        cycleThru();
                });
        }
        cycleThru();

    };

    jQuery(document).ready(function() {
        jQuery(".test ul li, ul.logos li").rotateImg();
    });

})();

It works fine when I am only calling it with one selector but when I add a second one the opacity change one multiple lists item at the same time (I think it’s half on the list item). My first unordered list has only two list item so I guess the bug has to do with it.

I am sorry for my bad english by the way and thank you for your help.

Oh… and I am using jQuery version 1.7.2

Edit : I have been able to replicate my bug. You can see it here : http://jsfiddle.net/selbh/5kDZn/18/

  • 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-13T22:39:46+00:00Added an answer on June 13, 2026 at 10:39 pm

    NEW VERSION

    http://jsfiddle.net/selbh/5kDZn/18/

    (function($){
    
        var j = 0;
        var delay = 500; //millisecond delay between cycles
    
    
        $.fn.rotateImg = function() {
    
            $(this).each(function () {
    
                var list = $(this).find('li');
                function cycleThru() {
                    var jmax = list.length -1;
                    list.eq(j)
                        .animate({"opacity" : "1"} ,800)
                        .animate({"opacity" : "1"}, delay)
                        .animate({"opacity" : "0"}, 800, function(){
                            (j == jmax) ? j=0 : j++;
                                cycleThru();
                        });               
                }
                cycleThru();
    
            });
    
    
    
        };
    
        $(function() {
            $(".test ul, ul.logos").rotateImg();
        });
    
    
    })(jQuery);​
    

    OLD VERSION:

    I’m not sure what you are trying to achieve. Maybe this is what you want:

    http://jsfiddle.net/selbh/5kDZn/17/

    (function($){
    
        var j = 0;
        var delay = 500; //millisecond delay between cycles
    
    
        $.fn.rotateImg = function() {
    
            var list = $(this);
            function cycleThru() {
                var jmax = list.length -1;
                list.eq(j)
                    .animate({"opacity" : "1"} ,800)
                    .animate({"opacity" : "1"}, delay)
                    .animate({"opacity" : "0"}, 800, function(){
                        (j == jmax) ? j=0 : j++;
                            cycleThru();
                    });               
            }
            cycleThru();
    
        };
    
        $(function () {
            $(".test ul li, ul.logos li").rotateImg();
        });
    
    
    
    })(jQuery);​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Maybe this has been answered before, but I was not able to find it.
maybe this question has already been answered somewhere on this site, but I'm not
Maybe this question has been asked many times before, but I never found a
Many apologies if this has been answered, but I have been unable to find
Sorry guys, maybe this has been asked before. But I googled around for several
I realize something like this has been asked, but this may be a little
OK, this may be really simple, but it is Friday and it has been
I have seen this talked about but never answered. Maybe it has and I'm
I've been reading several threads and questions about this issue but I didn't find
This question has been asked a number of times, I have noted, but none

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.