I've got the following code:
$("ul.relatedAlbums li").hover(function(){
$(this).css({fontWeight:"bold"});
},
function(){
$(this).css({fontWeight:"normal"});
});
I've heard good things about event delegation and speed performance. Using jQuery's delegate method, I imagine it would go something like:
$("ul.relatedAlbums").delegate("li", "hover", function(){
$(this).css({fontWeight:"bold"});
},
function(){
$(this).css({fontWeight:"normal"});
});
But reading the documentation, it says that this method is like using the live event. And I had always understood using the live event to be inefficient. So, could someone out there enlighten me on the best practices for this?