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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:07:54+00:00 2026-05-21T17:07:54+00:00

everyone! I’m not very good with JS/JQuery, so I need some help here… I

  • 0

everyone! I’m not very good with JS/JQuery, so I need some help here…

I have a page both vertically and horizontally centered. In this page I have a series of concentric circles, with a button in the centre.

What I want to accomplish is the following:

  • The page loads with all circles
    hidden (easily done with css
    display:none;)
  • When the ‘button’ in
    the centre is hovered over, I want
    the circles to fade in – in order
    from smallest to largest
  • When the
    ‘button’ is moused out, I want the
    circles to fade out – in order from
    largest to smallest

All of the circles are separate DIV elements, never overlapping each other.

Please feel free to check the code, and edit it if you have a solution.

Thanks, to anyone that helps!

Screenshot: http://cl.ly/6CJR

ALL CODE: http://cssdesk.com/cNeCx

Please view in Webkit!

  • 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-21T17:07:54+00:00Added an answer on May 21, 2026 at 5:07 pm

    There’s probably a cleaner way to write the setTimeout calls using jQuery, but this works.

    $(function() {
        var $circles = $('div.wrap4 > div:not(#box)').css('opacity', 0),
            numCircles = $circles.length,
            duration = 200,
            fadeIns = [],
            fadeOuts = [];
    
        function getNextCallback(s, o) {
            return function() {
                $(s).animate({opacity: o}, duration);
            };
        }
    
        function stopFadeIn() {
            var i = fadeIns.length;
            while (i--) {
                clearTimeout(fadeIns[i]);
            }
            fadeIns = [];
            $circles.stop();
        }
    
        function stopFadeOut() {
            var i = fadeOuts.length;
            while (i--) {
                clearTimeout(fadeOuts[i]);
            }
            fadeOuts = [];
            $circles.stop();
        }
    
        $('#box').hover(function() {
            // button mouseover
            var start = numCircles,
                i = 0;
    
            stopFadeOut();
    
            while (start--) {
                fadeIns.push(setTimeout(getNextCallback('#cc' + start, 1), duration * i++));
            }
        }, function() {
            // button mouseout
            var i, end = numCircles;
    
            stopFadeIn();
    
            for (i = 0; i < end; i++) {
                fadeOuts.push(setTimeout(getNextCallback('#cc' + i, 0), duration * i));
            }
        });
    });
    

    Demo: http://jsfiddle.net/mattball/xkLgf/

    Fin.

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

Sidebar

Related Questions

everyone, i have no idea why this doesn't work hopefully someone here can help
everyone I got problem here I need to update a plist data in a
everyone. I'm trying to get data from some page, it's updated using javascript. First,
Hi everyone in my main html file, I have this div that some img
Hii everyone! I have some text fields in each cell of the table view,
Everyone has accidentally forgotten the WHERE clause on a DELETE query and blasted some
Everyone in my office uses Macs and therefore most use Safari. We have a
Everyone uses source-code control to manage versions (right?) and this provides some level of
everyone, I have this piece of the code: void foo(int var, int var1) {
everyone! I've been at this for a while, and I'm not sure how this

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.