Wednesday, February 17, 2010

Index Of/img Girls How To Make Roll Over Image In Html Or Javascript?

How to make Roll over image in html or Javascript? - index of/img girls

Here is my code:

language = "javascript" \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; script type = "text / javascript">

normal_image = new Image ();
normal_image.src = "images / HOMENORM.bmp";

mouseover_image = new Image ();
mouseover_image.src = "images / HOME.bmp";


\\ \\ \\ \\ \\ \\ \\ \\ U0026lt;! - Repeat after the 4 lines about the pictures. ->

Swap function () (
if (document.images) (
for (var x = 0;
x \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; swap.arguments.length;
x + = 2) (
Document [swap.arguments [x]]. src = eval (swap.arguments [x 1] +. "src");
)
)
)
\\ \\ \\ \\ \\ \\ \\ \\ / U0026lt script>

\\ \\ \\ \\ \\ \\ \\ \\ U0026lt a href = "index.html" onmouseover = "swap ( 'name_of_img', 'normal_ ... onMouseOut =" swap (' name_of_img ',' Monuseove ...

name = "name_of_img" src = "images / HOME.bmp" border = "0"> \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; / a>

When I try to more than your mouse over the picture of the work or buttons, but the original code is executed when he was beside himself. I am wondering how to solve this problem

2 comments:

Anonymous said...

Good place to start:

http://www.htmlcodetutorial.com/images/i ...

Anonymous said...

This is a simplified version:

language = "javascript" \\ \\ \\ \\ \\ \\ \\ \\ u0026lt; script type = "text / javascript">

/ / Function ID change element and src
imgSwitch function (id, src)
(
var ele = document.getElementById (id);
ele.src = src;
)
\\ \\ \\ \\ \\ \\ \\ \\ / U0026lt script>

Use this:

\\ \\ \\ \\ \\ \\ \\ \\ U0026lt; img id = "myimg" border = "0" onMouseOver = "imgSwitch (myimg ',' images / myImgOver_btn.jpg ')" onmouseout = "imgSwitch (' myimg ',' images / myImg_btn.jpg ")" src = "images / myImg_btn.jpg" />

Hope this helps!

Post a Comment