469,356 Members | 2,677 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

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 1363
8,652 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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.