国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

javascript控制層顯示或隱藏的方法

2019-11-20 12:00:38
字體:
供稿:網(wǎng)友

本文實例講述了javascript控制層顯示或隱藏的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:

<html><head><title>中國風(fēng)</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><script language="JavaScript">function showLay1(){  lay1.style.visibility="visible";  lay2.style.visibility="hidden";  lay3.style.visibility="hidden";}function showLay2(){  lay1.style.visibility="visible";  lay2.style.visibility="visible";  lay3.style.visibility="hidden";}function showLay3(){  lay1.style.visibility="visible";  lay2.style.visibility="visible";  lay3.style.visibility="visible";}</script><body><div id="lay1" style="position:absolute; left:60px; top:30px; width:250px; height:200px; index:1; visibility:visible">這是第一層內(nèi)容,它的背景是透明的</div><div id="lay2" style="position:absolute; left:60px; top:30px; width:250px; height:200px; index:2; visibility:hidden; background-color:silver">這是第二層內(nèi)容,它的背景是灰色的</div><div id="lay3" style="position:absolute; left:60px; top:30px; width:250px; height:200px; index:3; visibility:hidden"><br><br><br>這是第三層內(nèi)容,它的背景是透明的</div><form id="form1" style="position:absolute; left:70px; top:250px;"><input type="button" value="第一層" onclick="showLay1()"><input type="button" value="第二層" onclick="showLay2()"><input type="button" value="第三層" onclick="showLay3()"></form></body></html>

希望本文所述對大家的javascript程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 中牟县| 江达县| 安乡县| 洛宁县| 襄汾县| 尼玛县| 罗定市| 丰都县| 明溪县| 旺苍县| 措美县| 湘阴县| 利辛县| 东辽县| 阿图什市| 太保市| 龙陵县| 镇赉县| 阿图什市| 三台县| 乌兰县| 胶州市| 平遥县| 固镇县| 镇远县| 北川| 澳门| 惠州市| 邹城市| 哈巴河县| 白朗县| 江门市| 杨浦区| 堆龙德庆县| 凯里市| 怀来县| 图片| 西安市| 札达县| 上思县| 信宜市|