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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:36:07+00:00 2026-05-23T13:36:07+00:00

I have simplified what I am trying to achieve from my previous question. This

  • 0

I have simplified what I am trying to achieve from my previous question.

This is a example of the script I am trying to write: example when you hover over the image you can see the problem. Possible fix with a delay?

I have a list of product each with 2-5 thumbnail images. I want to create a hover function that cycles through the images hiding/showing the next image.

I did try to stack the images using z-index although this was causing too much of a problem.

This is the hover function that I have put together so far:

$(".image_cycle img").live("hover", function(){

    if ($(this).next("img").is(":hidden")) {
        $(this).next("img").fadeIn("slow",function(){
            $(this).siblings("img").hide();
        });
    } else {
        $(this).parent().find("img:first").fadeIn("slow",function(){
            $(this).siblings().hide();
        });
    }
});
  • 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-23T13:36:07+00:00Added an answer on May 23, 2026 at 1:36 pm

    This is a lightweight version of a cycle plugin which I’ve just whipped up:

    jQuery.fn.HoverCycle = function(params){
                var defaults = {
                    "Timeout": 1500,
                    "FadeSpeed": "slow"
                };
                var opts = $.extend(defaults, params);
                if(isNaN(opts.Timeout)){
                    throw "Hover Timeout value must be numeric";
                }
                (function(){
                    var valid = true;
                    if(isNaN(opts.FadeSpeed)){
                        opts.FadeSpeed = opts.FadeSpeed.toLowerCase();
                        valid = (opts.FadeSpeed == "slow" || opts.FadeSpeed == "fast");
                    }else if(opts.FadeSpeed <= 0){
                        valid = false;
                    }
                    if(!valid){
                        throw "FadeSpeed must be either numeric and above zero, or either 'slow' or 'fast'";
                    }
                })();
                return this.each(function (){
                    var cycleTimer;
                    var $firstImg = $currentImg = $(this).find("img:first");
                    $(this).mouseenter(function(){
                        cycleTimer = setInterval(function(){
                            var $nextImg = $currentImg.next();
                            if($nextImg.length == 0){
                                $nextImg = $firstImg;
                            }
                            $currentImg.fadeOut(opts.FadeSpeed, function(){
                                $nextImg.fadeIn(opts.FadeSpeed, function(){
                                    $currentImg = $nextImg;
                                });
                            });
                        }, opts.Timeout);
                    }).mouseleave(function(){
                        clearInterval(cycleTimer);
                    });
                });
            };
    

    Apply it to the container of the images, so in this case, the tag:

    $(".image_cycle").HoverCycle();
    

    It’ll loop through the images in the order they’re declared in the tag. You can override the fade speed and timeout duration via the constructor:

    $(".image_cycle").Cycle({ "Timeout": 3000, "FadeSpeed": "fast" });
    

    Where “Timeout” is the value in ms between it switching images, and “FadeSpeed” is the same permitted values as jquery’s fade functions (ie “fast”,”slow”, or a numeric value).

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

Sidebar

Related Questions

This is a simplified example of what I am trying to achieve, I'm relatively
I am trying to retrieve the AST from scala souce file. I have simplified
I'm trying to write an application using QNetworkManager. I have simplified the code down
I have (simplified for this question) a table 'TAB' with two columns 'id' (integer
Below is simplified example of what I am trying to achieve: class Product(models.Model): #
I have simplified my design to make this question more clear. (Design of models
I have simplified my code to this internal class Program { private static void
I am getting this error on a website I'm working on, I have simplified
I have this (simplified) class: public class StarBuildParams { public int BaseNo { get;
I have simplified an issue that I've been having trying to isolate the problem,

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.