.hover problem with houverout
In this example a unique class for each item in a list is needed. To do this I added the index of the hovered item to the class "hov".
The code:
- $(function() {
- var $items = $('#myitem');
- $items.hover(function(){
- var index = $items.index($(this));
- $(this).addClass('hov'+ index);},function(){$(this).removeClass('hov' + index);});
- });
The hoverout (.removeClass) does not remove the class. I don't know why.
Please help. Is there a better way to do that? And why the remove does not work?
jbobbele