Using event bubbling instead of event handling thanks to Ara

Pehlivanian http://arapehlivanian.com
This commit is contained in:
Sarven Capadisli 2009-05-24 01:38:11 +00:00
parent 456f3eeb50
commit 7e0a314768

View File

@ -203,7 +203,6 @@ $(document).ready(function(){
$("#notices_primary .notices").prepend(document._importNode(li, true));
$("#notices_primary .notice:first").css({display:"none"});
$("#notices_primary .notice:first").fadeIn(2500);
NoticeHover();
NoticeReply();
}
}
@ -221,17 +220,16 @@ $(document).ready(function(){
NoticeReply();
});
function NoticeHover() {
$("#content .notice").hover(
function () {
$(this).addClass('hover');
},
function () {
$(this).removeClass('hover');
}
);
function mouseHandler(e) {
$(e.target).closest('li.hentry')[(e.type === 'mouseover') ? 'addClass' : 'removeClass']('hover');
};
$('#content .notices').mouseover(mouseHandler);
$('#content .notices').mouseout(mouseHandler);
}
function NoticeReply() {
if ($('#notice_data-text').length > 0) {
$('#content .notice').each(function() {