给大家推荐个靠谱的公众号程序员探索之路,大家一起加油
<!DOCTYPE html>
<html>
<head>
<title>zzhjs2.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<script type="text/javascript">
function a() {
document.getElementById("dog2").style.top = "1px";
//document.getElementById("dog2").style.left=500px;
}
function b() {
document.getElementById("dog").src = "dog1.jpg";
document.getElementById("dog2").style.top = "-1000px";
}
function c() {
text = document.getElementById("t");
text.innerHTML = "谁点谁小狗";
}
</script>
<style>
#dog2 {
position: absolute;
left: 500px;
top: -600px;
}
#t {
color: red;
size: 50px;
}
</style>
</head>
<body>
<img id="dog" src="dog1.jpg" onmouseover="a();" onmouseout="b();"
onclick="c();" />
<div id="dog2">
<img src="dog2.jpg" />
</div>
<div>
<font id="t"></font>
</div>
</body>
</html>
onmouseover 是鼠标移上 onmouseout 是鼠标移开 onclick是点击