Is it possible to cancel switchClass transition?
I want the element to slowly get class A when you hover over it and slowly lose it again once the mouse is gone. However, the function seems buggy, and calling .stop(0,1) does not seem to help. Actually, this seems to violate him.
I have a live example here . Yes, it is 404 pages, but it does not matter. Navigation should gradually gain or lose a class, but it just jumps. The script can be found here .
Is such a transition possible?
EDIT:
Here is the code I'm using:
$('#navbar li:not(.current) a').hover(function() { $(this).parent() .stop(1,0) .addClass('current', 1000); }, function () { $(this).parent() .stop(1,0) .removeClass('current', 1000); });
Perhaps because changing the class li does not lead to a transition in the style of its children?
EDIT2:
Yes, this is "fixed." Now a true mistake can be observed in all its glory (freezing in an intermediate state).
source share