Hi

I have the following jQuery code, but it doesn't seem to work 100%:
        $('.nav a img').hover(
                function(){
                        if($(this).attr("src").indexOf("_on") == -1) {
                                var newSrc = 
$(this).attr("src").replace(".png","_on.png");
                                $(this).attr("src",newSrc);
                        }
                },
                function(){
                        if($(this).attr("src").indexOf("_on.png") != -1) {
                                var oldSrc = 
$(this).attr("src").replace("_on.png",".png");
                                $(this).attr("src",oldSrc);
                        }
                }
        );

I am currently using it on the menu on my website
http://www.njwebdesign.co.za/

I want the selected/highlighted page to stay highlighted when it is hovered
over and not to be deselected. This is not currently working with the above
piece of code, if you have anything better or can help me fix the above, it
will be greatly appreciated.

Thanks. :-((
-- 
View this message in context: 
http://www.nabble.com/Menu-Hover-and-Selected-tp22999583s27240p22999583.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to