Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Website Design (https://www.warriorforum.com/website-design/)
-   -   Mouseover Javascript (https://www.warriorforum.com/website-design/206257-mouseover-javascript.html)

Voyager64 27th April 2010 06:11 AM

Mouseover Javascript
 
Hi there,

I want to put web 2.0 style buttons on my website - the ones where when you hover over them it changes colour. I am told this is javascript on mouseover?

I have found a website where I can make the buttons which I have done but can anyone point me in the right direction on how to write the script or html code to place on my website?

Thanks in advance

Jonathan

theIMgeek 27th April 2010 11:10 AM

Re: Mouseover Javascript
 
The script for this is contained within the IMG tag for the button graphic.

HTML Code:

<a href="/link-to-page"><img src="/images/button_regular.gif" onmouseover="this.src='/images/button_hover.gif';" onmouseout="this.src='/images/button_regular.gif';" /></a>
So onmouseover changes the image source to your highlighted graphic, and onmouseout changes it back.

-Ryan

VicFranks 2nd May 2010 07:16 PM

Re: Mouseover Javascript
 
Might check into CSS image rollovers.

If someone is browsing with javascript disabled they will still be able to view you wonderful creativity and efforts.. ;)


All times are GMT -6. The time now is 02:42 AM.