Connecting Tech Pros Worldwide Help | Site Map

On Mouse over- Change image help!

 
LinkBack Thread Tools Search this Thread
  #1  
Old August 27th, 2008, 08:32 PM
Newbie
 
Join Date: Aug 2008
Posts: 11
Default 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! :)
Reply
  #2  
Old August 27th, 2008, 09:25 PM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 32
Posts: 2,209
Default

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

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

--Kevin
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.