$("body *").live('mouseover', function() {
var currentId = $(this).attr('id');
var html = "<div id='perfect4' style='font-size:10px;'><div id='pos1'><br>ID: " +currentId+
" <br>Klasse: " +currentClass+ " </div><div id='pos' style='width:300px'></div></div>";
$("#perfect4").html(html).replacewith(html);
});
,在FF,因为有一个错误的原理(replacewith
) 我知道,replaceWith
将是正确 ,但不这样做,它不会工作问题与jQuery内容加载到DIV
是不工作:
$("#perfect4").html(html)
为什么?
,你必须定义currentClass? – Vivek 2011-05-12 09:44:27
[jQuery与.live,.mouseover和.replaceWith/.html问题]的可能重复(http://stackoverflow.com/questions/5979635/jquery-problem-with-live-mouseover-and-replacewith-html) – 2011-05-12 14:45:07