Author Topic: Change Images dynamically by Java Script  (Read 5233 times)

Offline admin

  • Administrator
  • Sr. Member
  • *****
  • Posts: 296
    • View Profile
Change Images dynamically by Java Script
« on: March 19, 2009, 02:20:17 PM »
Code: [Select]
<!-- TWO STEPS TO INSTALL CHANGE IMAGE:

   1.  Paste the coding into the HEAD of your HTML document
   2.  Add the last code into the BODY of your HTML document  -->

<!-- STEP ONE: Copy this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT language="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://developers-heaven.net -->

<!-- Begin
function movepic(img_name,img_src) {
document[img_name].src=img_src;
}
// End -->
</SCRIPT>
<!-- STEP TWO: Put this code into the BODY of your HTML document  -->

<BODY>

<!-- Be sure to give each image a name! (<img name="button">)
     Include that name in the onmouseover/onmouseout tags! -->

<CENTER>
<A HREF="http://developers-heaven.net"
onmouseover="movepic('button','pic-off.gif')"
onmouseout="movepic('button','pic-on.gif')">
<IMG NAME="button" SRC="pic-off.gif" ALT="Image"></A>
</CENTER>

<p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="http://developers-heaven.net">The JavaScript Source</a></font>
</center><p>