导航:首页 > 万维百科 > 网页设计隐藏与显示

网页设计隐藏与显示

发布时间:2020-12-27 23:44:15

1、网页制作。有什么方法可以让一段网页中的文字用一个按钮控制隐藏和显示吗?

下载 "jquery-1.7.min.js"

<script>

$("a").click(function () {
$("p").slideToggle("slow");
});
</script>
“a”表示点击的内容
“p”表示隐藏和显示的内容。
自己可以试试!

2、怎样让页面设计的隐藏框都显示出来

你双击图中display:none的地方,改为display:block就可以在页面看到这个隐藏的div
如果你几个div位置相同,你最好一个个显示.否则可能会被其他div挡住.导致你看不到它的显示.

3、网页制作中,如何实现层或者图片显示隐藏效果,高人见内

给段参考的代码,再给个参考内容页面,可以看下

<!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>
</head>
<body>
<div id="div" style="width:200px;height:200px;background-color:#ddeeff;filter:Alpha(Opacity=0);opacity:0;" onmouseover="starchina()" onmouseout="starchina2()"><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /><img src="newtopic.gif" width="90" height="31" /></div>
<div id="under" ><input name="" type="button" / onclick="starchina()"></div>
</body>
<script type="text/javascript">
var o = document.getElementById("div");
var i=0;
var j=100;
var sobjTimer;
var sobjTimer2;
function change(){
i++;
o.style.filter = "Alpha(Opacity=" + i + ")"; //for IE
o.style.opacity = i/100; //for FF
if(i>100) {window.clearInterval(sobjTimer);}
}
function change2(){
j--;
o.style.filter = "Alpha(Opacity=" + j + ")"; //for IE
o.style.opacity = j/100; //for FF
if(j<0) {window.clearInterval(sobjTimer2);}
}
function starchina(){
sobjTimer =window.setInterval(change,10);
}
function starchina2(){
sobjTimer2 =window.setInterval(change2,10);
}

</script>
</html>

4、怎样在网页中设计一个按钮,点下后在当前网页出现隐藏内容.

用js或者jquery控制隐藏显示就行了,很简单的,就一段代码的事情,不会你q我

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">
<head><title>
无标题页
</title>
<scripttype="text/javascript"src="javascript/jquery-1.7.2.min.js"></script>
<scripttype="text/javascript">
$(function(){
$("#Button1").click(function(){
$("#flash").slideDown(function(){$("#Button1").hide();});
});
});
</script>
</head>
<body>
<inputid="Button1"type="button"value="button" />
<divid="flash"style=" width:100px; height:100px; border:1px solid #ff0000; display:none;"></div>
</body>
</html>

给你附上代码,jquery库你去下一个,放到同一个路径就行了,这个没Jquery库不能运行的

5、网页设计中怎么隐藏列表?

你设置那麼多border-style 什麼的那麼多干嘛,直接删除所有Border的设置属性,用一句话来代替 border:none; 同时,table属性还要设置一下 .

6、在网页制作中层的隐藏和显示怎么弄啊

function doDisplay(act){ var tips =document.getElementById(act); if( act ==1 ){ //显示 tips.style.display = "block"; }else{ //隐藏 tips.style.display = "none"; } } 在需要的地方调用doDisplay这个函数,传递的参数就是需要显示很隐藏的层的id

7、网页制作(ASP) 如何隐藏和显示表单

<script> function reg() { if(document.getElementById("userform").style.display=="none") { document.getElementById("userform").style.display=""; } else { document.getElementById("userform").style.display="none"; } } </script> <a href="javascript:reg();">注册抄</a> <form name="userform" action="/hello.ASP" method="post" style="display:none"> 注册内容~! </form>

希望采纳

8、制作网页时 内容的显示和隐藏的代码

好好回答一下,以下代码实现你所说的效果,演示之用:
代码是在网上转的,我作了一点注释,下面代码保存为.html可以看到效果。
<html>
<head>
<title></title>
<script type="text/javascript">
function show(){
if(document.getElementById("table_foot").style.display=="block")
{//如果id为table_foot的标签style.diplay属性为block,则执行:
document.getElementById("table_foot").style.display="none";
}else{
document.getElementById("table_foot").style.display="block";
}
}
</script>
</head>
<body>
<table border="1" width="100%">
<tr id="table_head" onclick="show()" style="cursor:pointer;">
<td align="center">点击这里显示内容</td>
</tr>
<tr id="table_foot" style="display:none;"><!--看这里ID值在这儿。 -->
<td height="300" align="center" valign="middle" >你看到我没啊?哈!圣诞快乐!</td>
</tr>
</table>
</body>
</html>

与网页设计隐藏与显示相关的知识