Problem with event bubbling. The mouseover event is fired from the image and then bubbles up the DOM and fires from the tr; therefore, the change to opacity on the image's mouseover function is overridden by the change to its opacity on the tr's mouseover function (so it stays at .5).
To correct, you need to stop the bubbling after the event fires from the image:
Also, end() is unnecessary if you're not going to chain more methods after it.Code:$("img").live({ mouseover:function(e){ $(this).css('border','1px solid black').css('opacity','1'); e.stopPropagation(); }, mouseleave:function(){ $(this).css('border','0px').css('opacity','0.5'); } });




Reply With Quote