Quantcast
Channel: seo - develop
Viewing all articles
Browse latest Browse all 8

老爱出品:提示是否弹出thickbox框

0
0

/*************************************************\
*    thickbox 的扩展方法
*
*    作用:在弹出thickbox前,需要确认,是则探出thickbox框;否则取消

*    使用方法(一个a标签的参数):
*        链接增加一个class=’tb’
*        value=’需要提示的代码’
*        需要的参数:href=”目标链接” (具体的thickbox参数请参照thickbox官方方站的说明)
*        可选参数 title=”thickbox标题”
*    eg:
*        <a  value=’弹出确认框的提示信息’ href=”index.php?name=departments&action=department&i=1&tb_Frame=true&width=600&height=400″ title=”thickbox的提示标题” class=’tb’>测试链接</a>
*
*
*    author : wlfkongl@http://www.mmfei.cn
\*************************************************/

$(document).ready(function(){
    $(’a.tb’).click(function(){
        var sT = $(this).attr(’value’);
        if(!sT){
            sT = “你确定要执行该操作吗?”;
        }
        if(confirm(sT)){
            var sTitle = $(this).attr(’title’) || $(this).attr(’value’) || “”;
            var sHref = $(this).attr(’href’) || $(this).attr(’alt’) || “”;
            var bTarget = $(this).attr(’rel’) || false;
            tb_show(sTitle,sHref,bTarget);return false;
        }else{
            return false;
        }
    });
});

原文:http://www.mmfei.cn/index.php/archives/1288


Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images