jQuery waiting until one animation has finished prior to starting another -
I have a set of tabs due to which some DIVs have a 'flyout' option at the top of a parent DIV . The material is pulled through AJX.
Fly Out exclamation is clicked like
$ ('fly_out'). Live ('click', function () {var $ widget = $ (this) .closest () 'widgets.'; 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: by the' URL: DashboardApplicationRoot + $ flyOutURL, datatype: 'HTML', cache: false, success: $ ('.', 'Sharp' (). $ ('Striped Lee: nth-child (even)'). AddClass ('weird');}}); Description is false;});
I have a function to turn off flyouts:
function closeFlyout () {$ ('. Fly_container'). Chetan ({'right': '332'}, 'sharp', 'swing', function () {$ (this) .detach ();}); };
When another Floyd tab is clicked, and when he clicks on the Close button within the fly, it is called:
$ ('.flick_container .close'). Live ('click', function () {closeFlyout (); return false;});
I would like it to be extended if a fly open and the user clicks to begin the second flyout, then closed open Flayaut, but new fly out animation Wait for the finish before showing the new fly.
What is there about a global conflict that indicates that the flyout is open? Then use the timer to open the click event until the animation is complete.
// Global SpaceWare FlyOutActive = False; ('' Right ':' 332 '),' sharp ',' swing ', function () {$ (this) .detach (); // update active flag flyactive = false;}); }; // Ajax Call $ ('Fly_out'). Live ('click', function () [if (FlyOutActive) {// recursive function waits for animation to complete call setimer ($ ('.flow_out')., 100)} and {var $ widget = $ (this) .clostest ( '. 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 flyout Close (); $ .Azax ({Type: 'GIT', URL: DashboardAppRoot + $ FlyoUur URL, Datatype: 'HTML', Cash: False, Success: Function Tion (Data) { $ ($ Widget) .prepend (data); $ ('. Fly_container'). Chetan ({'true': '0'}, 'sharp'); $ ('. Scroll') jScrollPane () .; $ ('Striped Lee: nth-child (even)'). AddClass ('weird'); FlyOutActive = True; }}); return false; }});
Comments
Post a Comment