Leave a comment
◎歡迎參與討論,請在這里發表您的看法、交流您的觀點。
/*************************************************\
* 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
◎歡迎參與討論,請在這里發表您的看法、交流您的觀點。
這個作品很強大