| Posted by Viabug123 on 07/04/25 11:45 
I have an effect of changing images in javascript. When mouse overimage1, it changes to image2.
 But I don't know how to import the above javascript effect in the body
 of html, so that I can design the html page. There is no function of
 <body onmouseover="function();...>. Could anyone suggest me any ideas
 to solve it? Thanks a lot.
 
 
 onMouseOver="handlePress();return true;"
 onMouseUp="handleRelease();return true;"
 ....
 if (document.images) {
 img_on =new Image();  img_on.src ="image/1.gif";
 img_off=new Image();  img_off.src="image/2.gif";
 }
 
 function handlePress() {
 if (document.images) document.imgName.src=img_on.src;
 }
 
 function handleRelease() {
 if (document.images) document.imgName.src=img_off.src;
 }
  Navigation: [Reply to this message] |