初探js特效魅力01
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>js特效</title>
<script>
function go(){
document.getElementById('div1').style.display='block';
}
function out(){
document.getElementById('div1').style.display='none';
}
function toGreen(){
document.getElementById("div2").style.width="300px";
document.getElementById("div2").style.height="300px";
document.getElementById("div2").style.background="green";
}
function toRed(){
document.getElementById("div2").style.width="100px";
document.getElementById("div2").style.height="100px";
document.getElementById("div2").style.background="red";
}
</script>
<style>
#div1{
width:300px;
height:100px;
border:1px solid black;
background-color:#F00;
display:none;
}
#div2{
width:100px;
height:100px;
background:red;
}
</style>
</head>
<body>
<input type="checkbox" onmouseover="go()" onmouseout="out()"/>複選框
<div id="div1">滑鼠懸浮複選框是提示內容!div1</div>
<br /><br /><br /><br /><br /><br /><br /><br />
<div id="div2" onmouseover="toGreen()" onmouseout="toRed()">div2</div>
</body>
</html>