導航:首頁 > 萬維百科 > 網頁設計隱藏與顯示

網頁設計隱藏與顯示

發布時間: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>

與網頁設計隱藏與顯示相關的知識