烈火网(LieHuo.Net)教程 这是一个非常简单的应用,这个应用在过去几年在网页上创建可折叠区域是非常普遍的。其基本思想就是用CSS的display特性就可以完成。
<html> <head> <title> 用JavaScript 实现可折叠区域代码-LIEHUO.NET </title> <body> <div style="background-color:blue;color:white;font-weight:bold; padding:10px;cursor:pointer" onclick="toggle('divContent1')">点击</div> <div div style="border:3px solid blue;height:100px;padding:10px" id="divContent1"> 这段内容用于演示隐藏与显示</div> <p> </p> <div style="background-color:blue; color:white;font-weight:bold; padding:10px;cursor:pointer" onclick="toggle('divContent2')">点击这里</div> <div style="border:3px solid blue; height:100px;padding:10px" id="divContent2">这段内容用于演示隐藏与显示.</div> </body> </html><br /><center>烈火网更多教程,请访问:<a href=http://www.veryhuo.com/ target=_blank _fcksavedurl="http://www.veryhuo.com/ target=_blank">http://www.veryhuo.com/</a></center>提示:可修改后代码再运行!