Friday, December 25, 2009

How can I make a different image appear when an image is clicked for myspace?

If you click or even move the cursor over it %26amp; it changes to a whole diff pic. I wonder if it's possble...



How can I make a different image appear when an image is clicked for myspace?

They are called image roll-over codes. When you place your cursor over an image, the image changes into another image.



How can I make a different image appear when an image is clicked for myspace?

It can be done using javascript. To change it when the mouse moves over it:



%26lt;img src="pic1.jpg" id="image1"



onMouseOver=



"document.getElementById



('image1').



src = 'pic2.jpg' " %26gt;



If you want it to change back when the mouse moves off it again:



%26lt;img src="pic1.jpg" id="image1" onMouseOver=



"document.getElementById



('image1').



src = 'pic2.jpg' "



onMouseOut=



"document.getElementById



('image1').



src = 'pic1.jpg' "%26gt;



To make it change on click, use onMouseDown and onMouseUp instead of onMouseOver and onMouseOut. Also, you do not need the line breaks in teh code, I simply put them there so the message would not be truncated to to width restrictions.

No comments:

Post a Comment

 
web ftp hosting