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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:56:14+00:00 2026-05-30T08:56:14+00:00

I have a jQuery function where certain divs fade in and out, I cant

  • 0

I have a jQuery function where certain divs fade in and out, I cant paste my entire file into a jsFiddle as its too large and all image links are relative, I have the following however…

// On click hide default, Country specific
    $('.default .asia').click(function(){
        $('.default').fadeOut("fast");
        $(".default").queue(function () {
            $('.viewport-asia').fadeIn("fast");
            $('.viewport-asia').dequeue();
        });         
    });
    $('.default .north-america').click(function(){
        $('.default').fadeOut("fast");
        $(".default").queue(function () {
            $('.viewport-america').fadeIn("fast");
            $('.viewport-america').dequeue();
        });
    });
    $('.default .europe').click(function(){
        $('.default').fadeOut("fast");
        $(".default").queue(function () {
            $('.viewport-europe').fadeIn("fast");
            $('.viewport-europe').dequeue();
        });
    });

    // Drag event
    $(".america-big").draggable();
    $(".europe-big").draggable();
    $(".asia-big").draggable();

    // Reset map
    $('a.zoom-out').click(function(){
        $('.hidden').fadeOut("fast");
        $(".hidden").queue(function () {
            $('.default').fadeIn("fast");
            $('.hidden').dequeue();
        }); 
    })
}); 

The last function // Reset Map “a.zoom-out” should fade out the current div and fade in the .default div, its currently fading out the current div but the default div isn’t fading back in?

Can anybody see where im going wrong?


HTML

<div class="map">

    <!-- // Default Map -->
    <div class="default">
        <div class="asia"><img src="map/asia.png" alt="Asia"></div>
        <div class="north-america"><img src="map/north-america.jpg" alt="America"></div>
        <div class="europe"><img src="map/europe.jpg" alt="Europe"></div>
    </div>

    <!-- // Animated Map // North America -->
    <div class="viewport-america hidden">
        <div class="compass">
            <a href="#" class="arrow top">Top</a>
            <a href="#" class="arrow right">Right</a>
            <a href="#" class="arrow bottom">Bottom</a>
            <a href="#" class="arrow left">Left</a>
        </div>
        <a href="#" class="zoom-out">Zoom Out</a>
        <div class="instructions"><img src="map/instructions.png" alt="Instructions"></div>
        <div class="america-big"><img src="http://placekitten.com/1989/996" alt="America" /></div>
    </div>

    <!-- // Animated Map // Europe -->
    <div class="viewport-europe hidden">
        <div class="compass">
            <a href="#" class="arrow top">Top</a>
            <a href="#" class="arrow right">Right</a>
            <a href="#" class="arrow bottom">Bottom</a>
            <a href="#" class="arrow left">Left</a>
        </div>
        <a href="#" class="zoom-out">Zoom Out</a>
        <div class="instructions"><img src="map/instructions.png" alt="Instructions"></div>
        <div class="europe-big"><img src="http://placekitten.com/2000/1000" alt="Europe" /></div>
    </div>

    <!-- // Animated Map // Asia -->
    <div class="viewport-asia hidden">
        <div class="compass">
            <a href="#" class="arrow top">Top</a>
            <a href="#" class="arrow right">Right</a>
            <a href="#" class="arrow bottom">Bottom</a>
            <a href="#" class="arrow left">Left</a>
        </div>
        <a href="#" class="zoom-out">Zoom Out</a>
        <div class="instructions"><img src="map/instructions.png" alt="Instructions"></div>
        <div class="asia-big"><img src="http://placekitten.com/1999/999" alt="Asia" /></div>
    </div>

</div>
  • 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-30T08:56:15+00:00Added an answer on May 30, 2026 at 8:56 am

    You do not need the queue function.

    If you want the fadeIn and fadeOut at the same time:

    $('.default .asia').click(function(){
        $('.default').fadeOut("fast");
        $('.viewport-asia').fadeIn("fast");
    });
    

    If you want the fadeOut first and after it finishes the fadeIn:

    $('.default .asia').click(function(){
        $('.default').fadeOut("fast", function(){
            $('.viewport-asia').fadeIn("fast");
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jQuery setInterval function named timerIncrement that times out (stops incrementing the
I have a jQuery function that performs slideDown anitmation on a certain element when
I have a jQuery function that when a certain button is clicked it removes
I have a jQuery function already to perform the task I need but is
I have a jQuery UI Dialog working great on my ASP.NET page: jQuery(function() {
Here's the story... I have a jQuery function that does something, this function is
I have the following jquery function for filtering the contents of a listbox on
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following jQuery function: $(function(){ if ($(.menu li).hasClass(active)) { $(.active).css(margin-top, 6px); }
I have a jQuery post function that returns a response on success after the

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.