Side navigation
Ticket #3966: jQuery_event_bug.js
File jQuery_event_bug.js, 0.5 KB (added by ebello, January 22, 2009 09:11PM UTC)
// this works in 1.2.6, but in 1.3.1, the mouseover event only gets applied to the first div created
$("<div class=\"overlay\"></div>").mouseover(function() {
$("#primary-nav div.overlay:hidden").show();
$(this).hide();
}).appendTo($("#primary-nav > ul > li"));
// I had to convert the code to:
$("#primary-nav > ul > li").each(function() {
$("<div class=\"overlay\"></div>").mouseover(function() {
$("#primary-nav div.overlay:hidden").show();
$(this).hide();
}).appendTo(this);
});
Download in other formats:
Original Format
File jQuery_event_bug.js, 0.5 KB (added by ebello, January 22, 2009 09:11PM UTC)
// this works in 1.2.6, but in 1.3.1, the mouseover event only gets applied to the first div created
$("<div class=\"overlay\"></div>").mouseover(function() {
$("#primary-nav div.overlay:hidden").show();
$(this).hide();
}).appendTo($("#primary-nav > ul > li"));
// I had to convert the code to:
$("#primary-nav > ul > li").each(function() {
$("<div class=\"overlay\"></div>").mouseover(function() {
$("#primary-nav div.overlay:hidden").show();
$(this).hide();
}).appendTo(this);
});