通过js脚本实现点击文字链接切换图层或者隐藏起来,这是一款图层隐藏特效,根据自己的网站需求来修改即可。
<SCRIPT LANGUAGE="JavaScript"> <!-- Begin var ie4 = (document.all) ? true : false; var ns4 = (document.layers) ? true : false; var ns6 = (document.getElementById && !document.all) ? true : false; function hidelayer(lay) { if (ie4) {document.all[lay].style.visibility = "hidden";} if (ns4) {document.layers[lay].visibility = "hide";} if (ns6) {document.getElementById([lay]).style.display = "none";} }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) function showlayer(lay) { if (ie4) {document.all[lay].style.visibility = "visible";} if (ns4) {document.layers[lay].visibility = "show";} if (ns6) {document.getElementById([lay]).style.display = "block";} } function writetolayer(lay,txt) { if (ie4) { document.all[lay].innerHTML = txt; }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) if (ns4) { document[lay].document.write(txt); document[lay].document.close(); } if (ns6) { over = document.getElementById([lay]); range = document.createRange(); range.setStartBefore(over); domfrag = range.createContextualFragment(txt); while (over.hasChildNodes()) { over.removeChild(over.lastChild); } over.appendChild(domfrag); } }//武鸣人网站https://www.wuming.ren 网站很好记住,wuming.ren(武鸣拼音.ren域名后缀) // End --> </script> <body> <a href="https://www.wuming.ren">武鸣人</a>,各种信息资源免费发布,分享励志语录经典短句,减肥健身常识,各种js特效代码。网站很好记住,wuming.ren(武鸣拼音.ren域名后缀)<hr> <!--欢迎来到武鸣人信息资源平台,各种信息免费发布,资源共享合作共赢,分享互联网流行的励志语录经典短句,减肥健身健康小常识及打卡记录,收集各种js特效代码。--> <script type="text/javascript" src="https://www.wuming.ren/ad/tc.js"></script> <script type="text/javascript" src="https://www.wuming.ren/ad/a.js"></script> <SPAN ID="newlayer" style="position:absolute;; left: 400px; top: 55px; width: 230px; height: 16px">武鸣人提示您这里是层</SPAN> <div align="center"><br> <br> <br> <a href="javascript:hidelayer('newlayer');">隐藏层</a> | <a href="javascript:showlayer('newlayer');">显示层</a> | <a href="javascript:writetolayer('newlayer','武鸣人一号层');">显示层一</a> | <a href="javascript:writetolayer('newlayer','武鸣人二号层');">显示层二</a> </div> </body>
本文来自武鸣人网站,转载请注明出处