跳转到内容

BTEC IT 第 20 单元——网站设计/JavaScript/鼠标悬停

来自维基教科书,开放世界的开放书籍

图像鼠标悬停

<meta charset="utf-8">
<title>How to Make a JavaScript Image Rollover</title>
 
<!--JavaScript code goes here.-->
<script language="javascript">
        function MouseRollover(MyImage) {
         MyImage.src = "MyPicture2.jpg";
    }
        function MouseOut(MyImage) {
                MyImage.src = "MyPicture1.jpg";
    }
</script>
</head>
 
<body>
 
<div align="center">
 
<!--The rollover image displays here.-->
<img src="MyPicture1.jpg" boarder="0px" width="650px" height="550px" 
onMouseOver="MouseRollover(this)" 
onMouseOut="MouseOut(this)" />
</div>
 
</body>
华夏公益教科书