Hi!
i am new to javascript.i am trying to creat an photo gallery
in which image will appear one over another on mouse hover.but the code is not working.
i did
[CODE]document.getElementById(“hovers”).span.img.style.z-index=”2″;
but nothing seems to work.? .can any one suggest me how to fix this?
my code is here——
[CODE]<!doctype html>
<html>
<head>
<meta charset=”utf-8″>
<title>Untitled Document</title>
<script language=”javascript” type=”text/javascript”>
function changeindex() {
document.getElementById(“hovers”).span.img.style.z-index=”2″;
}
</script>
<style>
*{margin:0px;padding:0px;}
ul{list-style-type:none;}
</style>
</head>
<body>
<ul >
<li style=”position:relative;” >
<img src=”lom.jpg” width=”200px” height=”200px” style=”position:absolute;top:0px;” id=”hovers” onMouseOver=’changeindex();’/>
<span style=”position:absolute;left:300px;” ><img src=”lom.jpg” width=”400px” height=”400px” /></span>
</li>
</ul>
<img src=”images4.jpg” width=”400px” height=”400px” style=”position:relative;left:342px;top:0px;” />
</body>
</html>