- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="openorclosediv.aspx.cs" Inherits="openorclosediv" %>
-
- <!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 runat="server">
- <style type="text/css">
- #box4{padding:10px;border:1px solid green;}
- </style>
- <script type="text/javascript" language="javascript">
-
- 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>
- <title>鼠标点击展开关闭层效果</title>
- </head>
- <body>
-
- <p><button onclick="openShutManager(this,'box4',false,'点击关闭','点击展开')">点击展开</button></p>
- <div id="box4" style="display:none">
- 这里是div中的内容-欢迎方法http:
- </div>
- </body>
- </html>
posted @
2009-03-30 15:46
萌子
阅读(
371)
评论()
编辑
收藏
举报