[jQuery] Re: Menu Hover and Selected

2009-04-18 Thread victorg
Hmm, i've eaten better things :-P I tried to make it work using Firebug but its not a big success, since i cant attach new events after unbinding them somehow.. I think this should work: http://pastebin.com/m4c657bc9 Basically, what i am trying to do is this: Check what the active URL is right

[jQuery] Re: Menu Hover and Selected

2009-04-16 Thread Takaya213
I'm afraid you will have to eat your shoe, it doesn't work. :-(( http://www.njwebdesign.co.za/ victorg84 wrote: > > > Small correction.. > > var activePage = window.location.pathname.substr(1); > $("a[href="+activePage+"] img").trigger("mouseover"); > > -- View this message in context:

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread victorg
Small correction.. var activePage = window.location.pathname.substr(1); $("a[href="+activePage+"] img").trigger("mouseover");

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread victorg
Guess i made a mistake again. :P This should work now, if not i'll eat my shoe. $('.nav a img').hover( function(){ if($(this).attr("src").indexOf("_on") == -1) { var newSrc = $(this).attr ("src").replace(".png","_on

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread Takaya213
That's ok, we all misunderstand things at sometime or other. Unfortunatly this still removes the selected state of the button. Maybe it is due to the way that i am giving the button its selected state. victorg-2 wrote: > > > Ah, guess i misunderstood. > > A way to handle that could be to c

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread victorg
Ah, guess i misunderstood. A way to handle that could be to check what the current page is and highlight the menu item of the link who has a href to that page. And add an extra check to the mouseout function to only remove the _on suffix if its not the current page. Would something like this wor

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread Takaya213
Nope, not quite what I was looking for. I want the one that is selected (page that you are on e.g. Home) to stay selected when one hovers over it, and the others to show a hover and then change back to the unselected state, but the one that is selected (page you are on) to stay selected. vict

[jQuery] Re: Menu Hover and Selected

2009-04-11 Thread victorg
Maybe you should switch it to make use of the mouseover event only, and on mouseover change all menu items to off status and set the curret one to on? $(".nav a img").mouseover(function() { // clear all menu items with _on img $(".nav a img").each(function(){