Connecting Tech Pros Worldwide Help | Site Map

On Mouse over- Change image help!

  #1  
Old August 27th, 2008, 09:32 PM
Newbie
 
Join Date: Aug 2008
Posts: 11
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! :)
  #2  
Old August 27th, 2008, 10:25 PM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,493
Provided Answers: 10

re: On Mouse over- Change image help!


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. }
  #3  
Old August 28th, 2008, 03:57 AM
eWish's Avatar
Moderator
 
Join Date: Jul 2007
Location: Arkansas
Posts: 901

re: On Mouse over- Change image help!


This is more of a JavaScript question it appears. Moving to the JavaScript Forum.

--Kevin
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mouse Over Problem in FF karthickassistanz answers 4 April 6th, 2007 11:09 AM
On mouse over display large image tripathy.asish@gmail.com answers 2 February 13th, 2006 06:05 PM
Help on Mouse over feature/Click event Stephen answers 1 November 19th, 2005 01:13 AM
something strange is happening....with on mouse over windandwaves answers 1 July 23rd, 2005 07:10 PM
pyGTK on Mouse over event ? Domenique.Tilleuil@gmail.com answers 7 July 19th, 2005 01:14 AM