471,618 Members | 1,156 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,618 software developers and data experts.

Simple rollover buttons

I'm looking for a simple way to do rollover images in HTML, with as little javascript as possible. Any suggestions?
Aug 23 '07 #1
3 1236
ilikepython
844 Expert 512MB
I'm looking for a simple way to do rollover images in HTML, with as little javascript as possible. Any suggestions?
It's pretty simple:
Expand|Select|Wrap|Line Numbers
  1. <image src = "roll_out.bmp" onmouseover = "this.src = 'roll_over.bmp'" onmouseout = "this.src = 'roll_out.bmp'"/>
  2.  
Aug 23 '07 #2
Thanks for the help :)
Aug 23 '07 #3
drhowarddrfine
7,435 Expert 4TB
I'm leaving to go out of town in a couple of hours but there are solutions to this using CSS and no javascript. Google for "cssplay" and "Stu Nichols" for a starter but it is as simple as:
img:hover{}

Of course, that only works in modern browsers and not IE so you have to make the link an anchor <a><img></a> and then a:hover{}.
Aug 23 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Max Biancofiore | last post: by
4 posts views Thread by down_w/spam | last post: by
reply views Thread by Gepi Solo | last post: by
2 posts views Thread by Casimir | last post: by
reply views Thread by leo001 | last post: by
1 post views Thread by ZEDKYRIE | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.