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

The Archive Base Latest Questions

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

I have a set of tabs which cause certain DIVs with options to ‘fly

  • 0

I have a set of tabs which cause certain DIVs with options to ‘fly out’ over the top of a parent DIV. The content is pulled in via AJAX.

The fly outs are called on click like so

$('.fly_out').live('click', function() {

    var $widget = $(this).closest('.widget');

    var $flyOutIndex = $(this).index('.fly_out');

    if ($flyOutIndex == 0) {
        $flyOutURL = 'Content/HTMLSnippets/Flyouts/Priceassessment/product_order.htm';
    } else if ($flyOutIndex == 1) {
        $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_comparisons.htm';
    } else if ($flyOutIndex == 2) {
        $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_scenarios.htm';
    } else if ($flyOutIndex == 3) {
        $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_analysis.htm';
    }

    // Close any open flyouts
    closeFlyout();

    $.ajax({
        type: 'GET',
        url: DashboardApplicationRoot + $flyOutURL,
        dataType: 'html',
        cache: false,
        success: function(data) {

            $($widget).prepend(data);

            $('.fly_container').animate({ 'right': '0' }, 'fast');

            $('.scroll').jScrollPane();

            $('.striped li:nth-child(even)').addClass('odd');
        }
    });

    return false;

});

I have a function to close the flyouts:

function closeFlyout() {

    $('.fly_container').animate({
        'right': '-332'
    }, 'fast', 'swing', function() {
        $(this).detach();
    });

};

Which is called when another fly out tab is clicked and also when clicking a close button contained within the fly out itself:

$('.fly_container .close').live('click', function() {

    closeFlyout();

    return false;

});

I would like to extend this so that if a fly out is open and a user clicks to initialise another flyout, then the open flyout animates shut but the new fly out waits for this animation to finish before showing the new fly out.

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

    What about a global var that signals if a flyout is open? Then use a timer to invoke the click event until the animation completes.

    //Global space
    
    var flyOutActive = false;
    
    
    //Close Function
    
    function closeFlyout() {
    
        $('.fly_container').animate({
            'right': '-332'
        }, 'fast', 'swing', function() {
            $(this).detach();
    //update active flag
    flyOutActive = false;
    
        });
    
    };
    
    
    //Ajax call
    
    $('.fly_out').live('click', function() {
    
    if(flyOutActive)
    {
      //Recursive function call  waits for animation to complete
      setTimer($('.fly_out').click(),100)
    
    }
    else
    {
        var $widget = $(this).closest('.widget');
    
        var $flyOutIndex = $(this).index('.fly_out');
    
        if ($flyOutIndex == 0) {
            $flyOutURL = 'Content/HTMLSnippets/Flyouts/Priceassessment/product_order.htm';
        } else if ($flyOutIndex == 1) {
            $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_comparisons.htm';
        } else if ($flyOutIndex == 2) {
            $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_scenarios.htm';
        } else if ($flyOutIndex == 3) {
            $flyOutURL = 'Content/HTMLSnippets/Flyouts/PriceHistory/price_history_analysis.htm';
        }
    
        // Close any open flyouts
        closeFlyout();
    
        $.ajax({
            type: 'GET',
            url: DashboardApplicationRoot + $flyOutURL,
            dataType: 'html',
            cache: false,
            success: function(data) {
    
                $($widget).prepend(data);
    
                $('.fly_container').animate({ 'right': '0' }, 'fast');
    
                $('.scroll').jScrollPane();
    
                $('.striped li:nth-child(even)').addClass('odd');
    
                 flyOutActive = true;
            }
        });
    
        return false;
    }
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a set of Excel spreadsheets with multiple tabs which contains each one
I have a set of tabs, which all of them together contain alot of
I have set of Jquery-UI-Tabs which contains a save button for each tab. I
I currently have a set of tabs, each tied to a fragment, and I've
so I have this code for tabs in jquery, the href is set to
I have set a background on the data-role=page element like so <div data-role=page style=background:
I have set up Eclipse Indigo to do line debugging with CFEclipse over port
I am using a JTabbedPane in my application. I have added two tabs which
How to add Meta Data explicitly for tabs ? I have some pages which
I have an MVC masterpage set up which loads a dynamic menu using AJAX

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.