It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

Hovering over Button

Hovering over Button

Postby Chris on Tue Aug 01, 2006 8:39 am

I want to make the buttons on my website change colour when i hover over them. The button is an image so i don't know how to do this, any suggestions?

The Site[/img]
Chris
 
Posts: 23
Joined: Sun Dec 25, 2005 3:02 pm

Postby johneva on Tue Aug 01, 2006 10:14 am

Checkout a few of the tuorials on this and you will soo be able to make you nav work with rollover effect.

http://css.maxdesign.com.au/listamatic/index.htm

You use the hover propertie in CSS to do it but the tutorials are the best way for you to get used to how it works. ;)

All the tutorials use Basic text and coloured backgriounds but you can use images just as easy.
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby Chris on Tue Aug 01, 2006 10:44 am

http://wellstyled.com/css-nopreload-rollovers.html

I used the advice given in that page to do my rollover on the buttons, however, i must be doing it wrong because it won't work...any ideas?
Chris
 
Posts: 23
Joined: Sun Dec 25, 2005 3:02 pm

Postby johneva on Tue Aug 01, 2006 10:49 am

Ah right sound post us the exact code you have used and I will take a look over it. ;)
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby Chris on Tue Aug 01, 2006 10:51 am

http://javascript.internet.com/generato ... mages.html

Its alright now, i have found a generator and it works perfect! I strongly recommend this site ;)!
Chris
 
Posts: 23
Joined: Sun Dec 25, 2005 3:02 pm

Postby johneva on Tue Aug 01, 2006 10:55 am

No thanx Javascript menus suck and I know how to use CSS so it is pointless in me doing a javascript menu from a code generator.

I also really dont like code generators anyways cos I think it is better to know what the code does and why rather than just copy and pasting chunks of code when you have no idea how it works.
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby Chris on Tue Aug 01, 2006 11:05 am

I'm having one small problem though, the Home button and Graphics button do not change colour...

This is my code:

Code: Select all
<a href="http://www.freewebs.com/fmtemplate/home.html" onmouseover="image1.src='http://www.freewebs.com/fmtemplate/homehover.gif';"
onmouseout="image1.src='http://www.freewebs.com/fmtemplate/home.gif';">
<img name="image1" src="http://www.freewebs.com/fmtemplate/home.gif" border=0></a>

<a href="http://www.freewebs.com/fmtemplate/players.html" onmouseover="image2.src='http://www.freewebs.com/fmtemplate/playershover.gif';"
onmouseout="image2.src='http://www.freewebs.com/fmtemplate/players.gif';">
<img name="image2" src="http://www.freewebs.com/fmtemplate/players.gif" border=0></a>

<a href="http://www.freewebs.com/fmtemplate/players.html" onmouseover="image3.src='http://www.freewebs.com/fmtemplate/staffhover.gif';"
onmouseout="image3.src='http://www.freewebs.com/fmtemplate/staff.gif';">
<img name="image3" src="http://www.freewebs.com/fmtemplate/staff.gif" border=0></a>

<a href="http://www.freewebs.com/fmtemplate/tactics.html" onmouseover="image4.src='http://www.freewebs.com/fmtemplate/tacticshover.gif';"
onmouseout="image4.src='http://www.freewebs.com/fmtemplate/tactics.gif';">
<img name="image4" src="http://www.freewebs.com/fmtemplate/tactics.gif" border=0></a>

<a href="http://www.freewebs.com/fmtemplate/graphics.html" onmouseover="image1.src='http://www.freewebs.com/fmtemplate/graphicshover.gif';"
onmouseout="image1.src='http://www.freewebs.com/fmtemplate/graphics.gif';">
<img name="image1" src="http://www.freewebs.com/fmtemplate/graphics.gif" border=0></a>
Chris
 
Posts: 23
Joined: Sun Dec 25, 2005 3:02 pm

Postby johneva on Tue Aug 01, 2006 11:39 am

Where it says.

onmouseover="image1.src=

both the code for home and graphics are using the same you need to change the graphics one to onmouseove="image5.src='

Then same for onmouseout and image name too for the graphics part of the code.
Image
Only God Can Judge Me.
User avatar
johneva
500+ Club
 
Posts: 565
Joined: Sat Oct 29, 2005 1:16 pm
Location: Stafford, England

Postby Chris on Tue Aug 01, 2006 5:01 pm

Thanks a lot for your help Johneva.
Chris
 
Posts: 23
Joined: Sun Dec 25, 2005 3:02 pm

Postby Tomi on Sun Aug 06, 2006 11:26 am

i take it this is sorted ? but couldnt you simply use somthing like (expect mistakes, im not good at html and im writing it from scratch)

Code: Select all
<a href="LINK URL HERE" img src="IMAGE URL HERE" overscr="IMAGE 2 URL HERE" border="0">
User avatar
Tomi
500+ Club
 
Posts: 925
Joined: Mon Jun 26, 2006 6:51 pm
Location: Essex, England


Who is online

Users browsing this forum: No registered users and 5 guests