jquery .load() in .load() flickers. Why?
I'm usind this function to navigate inside a .load() content. The first two or three click-throughs are working but then I get a strange flickering between the .loaded subcontents.
$(document).ajaxComplete(function(){
$("ul.sub li a").live('click', function (e)
e.preventDefault();
$(".textbox").load($(this).attr("hr开发者_StackOverflow中文版ef") + " .subcontent");
});
});
Anybody know why?
SOLUTION:
$(function(){
$("ul.linkbox li a").live('click', function (e) {
e.preventDefault();
$(".textbox").load($(this).attr("href") + " .subcontent");
});
});
Thanks @karim79
Hard to say, but probably because you are adding a new click handler every time an ajax request completes?
精彩评论