你好,我想隱藏visibility:hidden
所採用的額外間距。在代碼中,當我選擇sort by date
時,它將被默認內容替換,但是當選擇sort by topic
時,它會按日期輸出進行排序。但我不想要這個。我想將sort of topic
的o/p替換爲sort by date
。我認爲這是因爲使用visibility:hidden
。任何人都可以建議我如何刪除該空間。我也使用display:none
,但沒用。隱藏由能見度引起的額外間距:隱藏
<html>
<head>
<script>
function onloadfun()
{
document.getElementById("hideall").style.visibility="hidden";
}
function optionCheck()
{
if(document.getElementById("sorting").value=="bydate")
{
document.getElementById("topic1").style.visibility ="visible";
document.getElementById("topic").style.visibility ="hidden";
document.getElementById("showByDefault").style.display ="none";
}
if(document.getElementById("sorting").value =="bytopic")
{
document.getElementById("topic1").style.visibility ="hidden";
document.getElementById("topic").style.visibility ="visible";
document.getElementById("showByDefault").style.display ="none";
}
// validation of dropdownlist
var x = document.getElementById("sorting");
var option = x.options[x.selectedIndex].value;
var strUser1 = x.options[x.selectedIndex].text;
if(option=="s")
{
document.form.options.focus();
return false;
}
return true;
}
</script>
</head>
<body onLoad="onloadfun()">
<form name="form">
<select id="sorting" style="width:140px" onChange="optionCheck()">
<option id="s">---Sort By----</option>
<option value="bydate">Sort By Date</option>
<option value="bytopic">Sort By Topic</option>
</select>
</form>
<br /><br /><hr /><br /><br />
<?php include 'connection.php'; ?>
<div id="showByDefault">
<?php
echo "default content";
?>
</div>
<div id="hideall">
<div id="topic1">
<?php echo "hideing 1"; ?>
</div>
<div id="topic">
<?php echo "hideing 2"; ?>
</div>
</div>
</body>
</html>
請刪除
標籤,然後嘗試 – Arun 2015-02-07 05:06:45
刪除
inn't工作。刪除
是不正確的方法來替換按主題內容排序。 – user3766182 2015-02-07 05:12:23
PHP提供的標記是什麼樣的?你能舉一個簡單的例子嗎?任何CSS? – Xotic750 2015-02-07 05:16:31