嗨,我正在为我目前正在开发的网站尝试简单的翻转图像。当我在Firefox中测试效果时,鼠标悬停效果会移动网页上的其他元素。对于如何解决这个问题,有任何的建议吗?
<head>
<script type="text/javascript">
if (document.images) {
img1 = new Image();
img1.src = "training2.png";
} </script></head>
<body>
<script type="text/javascript">
function rollover(name, filename)
{
var fullpath = '' + filename;
document.images[name].src = fullpath; }
</script>
<div id="trainingbutton"><a href="#" onmouseover="rollover('button1','training2.png');" onmouseout="rollover('button1','training.png')">
<img src="training.png" name="button1" border="0" alt="training" /></a></div></body>