JDP 發表於 2005-12-26 13:53:55

CSS控制 隱藏 & 顯示

CSS部份加入
/* Visibility Hidden */
.Hidden {
   visibility: hidden;
}
/* Visibility Visible */
.Visible {
   visibility: visible;
}
JavaScript部份
function classChange(element,newclass) {
element.className = newclass;
}
HTML部份
<p class="normal"
onMouseOver="classChange(invisible,'Visible')"
onMouseOut="classChange(invisible,'Hidden')">
This is a normal paragraph, placed after a paragraph
that has the class <strong>Hidden</strong>.
Move the mouse over this paragraph to reveal the
hidden one; move the mouse off to hide it again.
</p>
</div>

JDP 發表於 2005-12-26 13:54:34

Layer3.style.visibility = "visible"; <--顯示
Layer4.style.visibility = "hidden"; <--隱藏
頁: [1]
查看完整版本: CSS控制 隱藏 & 顯示