Apparently my JQuery events die when the elements are replaced. Currently they are attached like this:
$("a[id^='anb']").click(
function () {
/* ommited for readability */;
var furl = "target_view";
$('#my_article_container').load(furl, function() {
animateThem(); });
return false;
}
);
$("div[id^='art']").hover(
function() {
$(this).fadeTo("slow", 0.33);
}
);
Is there a mechanisme inside JQuery or a handy work around on how to re-bind these events?
You’re looking for the
.live()function.This will monitor the dom and reattach events automatically as items are added.