Thickbox的使用

1、父页面添加引用 link href=thickbox.css rel=stylesheet type=text/css / script src=jquery-1.2.6.js type=text/javascript/script script src=thickbox.js type=text/javascript/script 2、父页面添加如下链接地址: a href=Tree3Status/ParamSel.aspx?keepThis=t

 


  1、父页面添加引用    

      <link href="thickbox.css" rel="stylesheet" type="text/css" />
     <script src="jquery-1.2.6.js" type="text/javascript"></script>
     <script src="thickbox.js" type="text/javascript"></script>

  2、父页面添加如下链接地址:

<a href="Tree3Status/ParamSel.aspx?keepThis=true&TB_iframe=true&height=450&width=770" title="选择科目" class="thickbox" </a>

   也可以在上面拼接参数

  修改:

   thickbox 弹出层的遮住层透明度修改

.TB_overlayBG {
 background-color:#000;
 filter:alpha(opacity=75);
 -moz-opacity: 0.75;
 opacity: 0.75;
}

  关闭层:

οnclick="self.parent.tb_remove();"

  关闭层刷新父页面:

  修改:thickbox.js

  添加如下函数:

// 刷新打开本窗口的opener窗口.
function refreshOpener(){
// 可能存在frame页面,所以要引用top窗口
 
    var win = top.window;
    try
    {
        // 刷新.
        if(win)
        {
           win.location.reload();
        }
    }
    catch(ex)
    {
        // 防止opener被关闭时代码异常。
    }
}

// 刷新opener窗口后关闭自己。
function refreshOpenerAndCloseMe(){
 tb_remove();
 refreshOpener();

  然后修改  $("#TB_closeWindowButton").click(tb_remove);为

   $("#TB_closeWindowButton").click(refreshOpenerAndCloseMe);

 

http://www.fengfly.com/plus/view-81532-1.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值