简体   繁体   English

交互式地将另一个页面加载到DIV

[英]Interactively loading another page to DIV

I'm loading another page in to one of my DIVs with 我正在将另一页加载到我的一个DIV中

 $(divName).load("mypage")

Is there a "funner" way to do it ? 有没有一种“有趣的”方法呢? Have the DIV expand/slide down as the page is appearing ? 随着页面的显示,DIV是否已展开/向下滑动? Thanks in advance! 提前致谢!

$(divName).hide().load("mypage",
function(){
    $(divName).slideDown();}
);

You could use underscore.js to to a _.defer in the page load event and then inside your _.defer you could do the operations simultaneously: 您可以在页面加载事件中使用underscore.js到_.defer,然后在_.defer内部可以同时执行操作:

$(divName).load("mypage",function(){
    _.defer(function(){
        $(divName).fadeIn();
        $(divName).slideDown();
    });
});

Sounds fun to me ;) 对我来说听起来很有趣;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM