求问javascript这里的效果为什么出不来


<!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=gb2312" />

<title>个人简历</title>

<style type="text/css">

.p{

font-size:36px;

color:blue; 

}

.div{display:none;}

#div1{}

#div2{}

#div3{}

</style>

</head>

<body>

<div onmouseover="div1On()" onmouseout="div1Off()">

<h1>个人资料</h1>

</div>

<div id="div1">

****************

</div>

<div onmouseover="div2On()" onmouseout="div2Off()">

<h1>本人经历</h1>

</div>

<div id="div2">

                *********************

</div>

<div onmouseover="div3On()" onmouseout="div3Off()">

<h1>求职愿望和所学知识</h1>

</div>

<div id="div3">

        ****************

</div>

<script type="text/javascript">

var div1=document.getElementById("div1")

var div2=document.getElementById("div2")

var div3=document.getElementById("div3")

function div1On{

div1.style.display="";

}

function div1Off{

div1.seyle.display="none";

}

function div2On{

div2.style.display="";

}

function div2Off{

div2.seyle.display="none";

}

function div3On{

div3.style.display="";

}

function di31Off{

div3.seyle.display="none";

}

</script>

</body>

</html>

为什么这里的div123没有鼠标事件的影响啊

漫之旅
浏览 1306回答 3
3回答

Cmen

divoff的style写错了

Cmen

div3On也写错了,而且你添加鼠标事件的div没有设置高度,默认情况下为0就是没有高度,你鼠标也滑不到上面去啊。chrome下打开f12调试方便一些!
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript