Tip: you can modify some code before running
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Js controls the expand and close windows (display hidden layer)</title><meta http-equiv="content-type" content="text/html;charset=gb2312"><!--把下面代码加到<head>与</head>之间--><style type="text/css"># Box, # box2, # box3, # box4 {padding: 10px; border: 1px solid green ;}</style><script type="text/javascript">// = Click expand close result = function openShutManager (oSourceObj, oTargetObj, shutAble, oOpenTip, oShutTip) {var sourceObj = typeof oSourceObj = "string "? Document. getElementById (oSourceObj): oSourceObj; var targetObj = typeof oTargetObj = "string "? Document. getElementById (oTargetObj): oTargetObj; var openTip = oOpenTip | ""; var shutTip = oShutTip | ""; if (targetObj. style. display! = "None") {if (shutAble) return; targetObj. style. display = "none"; if (openTip & shutTip) {sourceObj. innerHTML = shutTip;} else {targetObj. style. display = "block"; if (openTip & shutTip) {sourceObj. innerHTML = openTip ;}}}</script></head><body><!--把下面代码加到<body>与</body>之间--><p>Click to expand</p><p id="box" >The box content is displayed here.</p><p>Click to expand</p><p id="box2" >The box content is displayed here.</p><p>Click to expand</p><p id="box3" >The box content is displayed here.</p><p><button onclick="openShutManager(this,'box4',false,'点击关闭','点击展开')">Click to expand</button></p><p id="box4" >The box content is displayed here.</p></body></html>
Tip: you can modify some code before running