Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下代码刷新 div,现在每当刷新页面时,它都会破坏布局,我不明白为什么会这样..
var auto_refresh = setInterval( function() { $('#loaddiv').fadeOut('slow').load('loadmore.php').fadeIn("slow"); }, 2000);
重新加载后
您正在将整个页面插入到元素中,您可以将选择器传递给load方法。
load
var auto_refresh = setInterval(function() { $('#loaddiv').fadeOut('slow').load('loadmore.php #target', function(){ $(this).fadeIn("slow") }); }, 2000);