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
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:
Small correction..
var activePage = window.location.pathname.substr(1);
$("a[href="+activePage+"] img").trigger("mouseover");
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
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
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
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
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(){
8 matches
Mail list logo