仅在没有鼠标事件时更新页面的一部分 [英] update a part of page only when there are no mouse events
本文介绍了仅在没有鼠标事件时更新页面的一部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
作为我的最后一个问题,我收到了许多有用的回复,如果我想更新,而不是整个页面只有一部分它(ID ='#colorbox') $ b
修改Rory McCrossan的代码:
https://stackoverflow.com/a/35579920/3387832
更改:
window.location.reload(false);
附带:
$('#colorbox')。load(window.location.href +'#colorbox');
或
$('#colorbox')。load('aa.html #colorbox')。fadeIn();
或
$('#colorbox')。load('aa.html');
但没有任何效果正常
解决方案
您可以试试这个,如果我正确理解您的问题:
$。get(window。 location.href,function(page){
$('#colorbox')。replaceWith($(page).find('#colorbox'));
});
as my last question I received many Useful replies,
if I want update instead a whole page only a portion of it (id='#colorbox')
modifying the Rory McCrossan code :
https://stackoverflow.com/a/35579920/3387832
changing:
window.location.reload(false);
with:
$('#colorbox').load(window.location.href + ' #colorbox');
or
$('#colorbox').load('aa.html #colorbox').fadeIn();
or
$('#colorbox').load('aa.html');
but none works fine
解决方案
You can try this, If I understand your problem correctly:
$.get(window.location.href, function(page) {
$('#colorbox').replaceWith($(page).find('#colorbox'));
});
这篇关于仅在没有鼠标事件时更新页面的一部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文