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
1 Answer
Reset to default 9It'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);
本文标签:
版权声明:本文标题:javascript - How to use JQuery UI slide effect to seamlessly slide out one div and slide in another div? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741305840a2371364.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论