Hi all,
About javascripting, I made a website with buttons.
When you roll over the buttons they change from colour.
Head
SCRIPT LANGUAGE=“JavaScript”
!-- Begin
home= new Image();
home.src = "images2/home_over.jpg";
// End –
/script
Body
a href="home.htm"onmouseover=“home.src=‘images2/home_over.jpg’;” onmouseout=“home.src=‘images2/home.jpg’;”
img name=“home” src=“images2/home.jpg” border=0 width=“51” height=“66” /a
This is working well with more buttons, I just have to repeat the code, but I want to go further, if you click on a button it should stay in his rollovercolour (red).
So they see they are at the home-section, if they click a new button like contact, the home button should return in his normal state and normal colour. And the contactbutton should change in the rollovercolour.
I think it has to be done with a onClick function or something and then keep it in a kind of memory.
I’m hoping that someones knows the solution :ub:
thx allready
If your buttons and content are all in the same page, then you can’t do that because your page changes therefore all the buttons will return to their original state when the new page loads. If you are using frames and the page that contains your buttons does not change, then you would use an onClick, but a function would have to be created to perform the action correctly.
Oh BTW: If all your items are on 1 page, then simple change the image that shows for the button which the page corresponds (so if you have a button that says “about” then on the about page change the default image of that button)
This will be more clear.
As you can see on the top frame, there are this rollover buttons.
If you click on a button, the middle frame changes, for example I clicked services, so this button should stay red, they know where they are then.
I want to create an easy navigation throughout my webpage.
I think an Onclickfunction should be possible then, because i’m using this frames.
Now I just need someone, who knows how to write this code or a tutorial website.