spritemenu customise

spritemenu customise

hello everyone,

i recently found this script that creates a nice menu with hover effect using only one image and used it on a website: http://www.distinctcorp.com.au/jquery/spritemenu.html .
now i'm trying to add a functionality: when the user click on an element, the clicked element should remain in hover state and of course the other elements should lose it.

i modified the core of the function adding:

.click(function(){
            /*alert("pop");*/
            $(this).parent().children('li').removeClass("active");
            $(this).addClass("active");
                     $(this).parent().children('li').children('a').children('span').stop().animate(aniParamsBack, {queue: true, duration: settings.speed, easing: settings.easing});
            $(this).children('a').children('span').stop().show().animate(aniParamsOrig, {queue: true, duration: settings.speed, easing: settings.easing});
            });

well... with the alert it works fine, but when i comment it no way to make it work. can anyone help me, please?
i lose already 12 hrs or so...

thanks a lot,


EDIT: Oh, i think i got it!!! the code would actually execute fine, but since after the click the mouse leaves the element, the alternative hover function gets executed!! how can i avoid it?