471,886 Members | 1,131 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

On Mouse over- Change image help!

I need a very brief, easy to use code that will let me show ne picture, but change it when the user puts their mouse over the pic.

I have about 20 i need to make, so brief will be appreciated! :)
Aug 27 '08 #1
2 1392
8,658 Expert Mod 8TB
um, this depends a little bit on your html (is it an <img> or a background?) and to what the next picture should be (a specific or random image?)

basicly it works like
Expand|Select|Wrap|Line Numbers
  1. var img = img_recource // use correct DOM here
  2. img.onmousover = function() {
  3.   img.src = new_img_source // add appropriate file name here
  4. }
Aug 27 '08 #2
971 Expert 512MB
This is more of a JavaScript question it appears. Moving to the JavaScript Forum.

Aug 28 '08 #3

Post your reply

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

Similar topics

9 posts views Thread by punkin | last post: by
7 posts views Thread by Larry R Harrison Jr | last post: by
5 posts views Thread by Nikolay Petrov | last post: by
19 posts views Thread by wmanzo | last post: by
reply views Thread by YellowAndGreen | 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.