I have an event handler bound to the hover event using the .hover method, which is below:
$(".nav li").hover(function () {
$(this).addClass("hover");
}, function () {
$(this).removeClass("hover");
});
It is important to note, that I require both functions within the handler to ensure synchronisation. Is it possible to rewrite the function using .delegate, as the following does not work?
$(".nav").delegate("li", "hover", function () {
$(this).addClass("hover");
}, function () {
$(this).removeClass("hover");
});
Rich