2个回答
展开全部
<html>
<body>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<input type="button" value="showdiv" onclick="showdiv()">
<div id="div1" style="position: absolute; color: red; left: 0px; top: 0px; height: 300px; width: 300px; background-color: red; display: none;"></div>
</body>
<script type="text/javascript">
showdiv = function(){
var div1 = document.getElementById("div1");
div1.style.height = document.body.clientHeight;
div1.style.width = document.body.clientWidth;
div1.style.display = "inline";
}
</script>
</html>
<body>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<input type="button" value="showdiv" onclick="showdiv()">
<div id="div1" style="position: absolute; color: red; left: 0px; top: 0px; height: 300px; width: 300px; background-color: red; display: none;"></div>
</body>
<script type="text/javascript">
showdiv = function(){
var div1 = document.getElementById("div1");
div1.style.height = document.body.clientHeight;
div1.style.width = document.body.clientWidth;
div1.style.display = "inline";
}
</script>
</html>
追问
谢啦 哥们 这是我们的作业。
追答
嗯,自己在改下层样式吧。我这个太丑了。。
本回答被提问者采纳
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询