admin管理员组

文章数量:1287147

I am using

$( "#viewPort" ).effect( "slide", hideoptions, 1000, callback )

to slide out the "viewPort" div, and in the callback() function I am sliding in the new div into the display by calling

$( "#viewPort2" ).effect( "slide", showoptions, 1000 )

var hideoptions = {  "direction" : "left",  "mode" : "hide";

var showoptions = {"direction" : "right","mode" : "show"};

The problem is that it is not seamless transition: first the content slides out leaving behind a blank area then the new content slides in.

Is there a way to avoid the blank display?

I am using

$( "#viewPort" ).effect( "slide", hideoptions, 1000, callback )

to slide out the "viewPort" div, and in the callback() function I am sliding in the new div into the display by calling

$( "#viewPort2" ).effect( "slide", showoptions, 1000 )

var hideoptions = {  "direction" : "left",  "mode" : "hide";

var showoptions = {"direction" : "right","mode" : "show"};

The problem is that it is not seamless transition: first the content slides out leaving behind a blank area then the new content slides in.

Is there a way to avoid the blank display?

Share Improve this question edited Nov 25, 2013 at 17:12 Irwin 12.8k12 gold badges72 silver badges97 bronze badges asked Sep 14, 2011 at 19:30 user193116user193116 3,5686 gold badges43 silver badges60 bronze badges 1
  • Change 1000 to something smaller, like 10. – Jack Commented Sep 14, 2011 at 19:33
Add a ment  | 

1 Answer 1

Reset to default 9

It's because you're calling the effect on #viewPort2 in the callback to the effect of #viewPort. That means it will occur only once the effect on #viewPort has fully finished. Try calling the effect on #viewPort2 right after the one on #viewPort, for example:

$( "#viewPort" ).effect( "slide", hideoptions, 1000); //notice, no callback
$( "#viewPort2" ).effect( "slide", showoptions, 1000);

本文标签: