- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <script language="javascript" type="text/javascript">
-
- //change d'une image a une autre (effet interupteur)
- function commuteImg(img1, img2, name)
- {
- var src_btn = eval("document."+name+".src");
- var str1 = src_btn.substring(((src_btn.length)-(img1.length)), src_btn.length);
-
- if (img1 == str1)
- {var tmp = eval("document."+name); tmp.src = img2;}
-
- else
- {var tmp = eval("document."+name); tmp.src = img1;}
-
- }
-
- </script>
- </head>
- <body>
-
- <!--Exemple 1 -->
- <img src="imgs/butn_tv_on.png" name="BTN_TV" onMouseover="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV')" onMouseOut="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV')">
-
- <br />
-
- <!--Exemple 2 -->
- <img src="imgs/butn_tv_on.png" name="BTN_TV_2" onClick="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV_2')">
-
- </body>
- </html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript" type="text/javascript">
//change d'une image a une autre (effet interupteur)
function commuteImg(img1, img2, name)
{
var src_btn = eval("document."+name+".src");
var str1 = src_btn.substring(((src_btn.length)-(img1.length)), src_btn.length);
if (img1 == str1)
{var tmp = eval("document."+name); tmp.src = img2;}
else
{var tmp = eval("document."+name); tmp.src = img1;}
}
</script>
</head>
<body>
<!--Exemple 1 -->
<img src="imgs/butn_tv_on.png" name="BTN_TV" onMouseover="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV')" onMouseOut="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV')">
<br />
<!--Exemple 2 -->
<img src="imgs/butn_tv_on.png" name="BTN_TV_2" onClick="commuteImg('imgs/butn_tv_on.png','imgs/butn_tv_off.png','BTN_TV_2')">
</body>
</html>