<html>
<head>
<script>
window.onload=rolloverInit;
function rolloverInit(){
for(var i=0;document.images.length>i;i++){
if(document.images[i].parentNode.tagName=="A"){
setupRollover(document.images[i]);
}
}
}
function setupRollover(thisImage){
thisImage.outImage=new Image();
thisImage.outImage.src=thisImage.src;
thisImage.onmouseout=function(){
this.src=this.outImage.src;
}
thisImage.overImage=new Image();
thisImage.overImage.src = thisImage.id + "_on.jpg";
thisImage.onmouseover=function(){
this.src=this.overImage.src;
}
}
</script>
</head>
<body>
<a href="link.html">
<img src="button_off.jpg" with="100" height="100' id="button">
</a>
<p>
<img src="file:///C:/Users/Administrator/Desktop/1测试/button_on.jpg" with="100" height="100' id="buon">
</p>
</body>
</html>
这个翻转器鼠标停留在图片上时显示不了图片,左上角有小X,我图片的命名都是正确的,地址都在相同的文件夹.本地文件夹
<head>
<script>
window.onload=rolloverInit;
function rolloverInit(){
for(var i=0;document.images.length>i;i++){
if(document.images[i].parentNode.tagName=="A"){
setupRollover(document.images[i]);
}
}
}
function setupRollover(thisImage){
thisImage.outImage=new Image();
thisImage.outImage.src=thisImage.src;
thisImage.onmouseout=function(){
this.src=this.outImage.src;
}
thisImage.overImage=new Image();
thisImage.overImage.src = thisImage.id + "_on.jpg";
thisImage.onmouseover=function(){
this.src=this.overImage.src;
}
}
</script>
</head>
<body>
<a href="link.html">
<img src="button_off.jpg" with="100" height="100' id="button">
</a>
<p>
<img src="file:///C:/Users/Administrator/Desktop/1测试/button_on.jpg" with="100" height="100' id="buon">
</p>
</body>
</html>
这个翻转器鼠标停留在图片上时显示不了图片,左上角有小X,我图片的命名都是正确的,地址都在相同的文件夹.本地文件夹