Saturday, 15 June 2013

jquery - first do slideup and fadeout on two html element then continue -



jquery - first do slideup and fadeout on two html element then continue -

i must slideup modalbox-dialog , fadout modalbox-overlay , must occur on same time not possible fade out in done function of slideup

$('#modalbox-dialog').slideup({ done:function() { } }); $('#modalbox-overlay').fadeout();

after slideup , fadeout done these things must performed

$('.nav > *').remove(); $('#foo-helper > *').remove(); $(filterview.currentdiv).insertafter('#hidden-divs-helper'); filterview.currentdiv = '';

use $.when()

$(document).ready(function() { var f1 = $('#modalbox-dialog').slideup({duration:10000}) var f2 = $('#modalbox-overlay').fadeout(); $.when( f1, f2 ).done(function ( v1, v2 ) { alert('finished both'); }); });

see fiddle: http://jsfiddle.net/olm8l1pl/

i set duration high demonstrate effect.

jquery fadeout slideup

No comments:

Post a Comment