JSPOP彈出框插件
基于jquery的仿微博頭像彈出框插件JSPOP
代碼一共6k,基于jquery的頭像彈出框?qū)崿F(xiàn),實現(xiàn)彈出信息的定位、信息配置、樣式定義。
1.下載地址:http://code.google.com/p/jspop/downloads/list
2.demo地址:http://wuzhi.me/jspopupdemo.php
3.配置說明:http://wuzhi.me/?p=65
var setting = {
// 過濾彈窗字段 當該字段為notpopup時不做彈出 如: filter:'filter',
// 返回可以作為彈窗關(guān)鍵子的字段 filterfunction:function(url){
key = url.replace(/\/u\/@/g,"");
return key;
},
// 500毫秒以內(nèi)仍然在才觸發(fā)彈出 hideDelay:500,
// 填充數(shù)據(jù)的url ajaxurl:'',
// 彈窗關(guān)鍵字 key:'key',
// 彈窗ID前綴,確保唯一 idpre:'jspopup_',
// 彈窗class,確保唯一 mainclass:'jspopup',
//等待提示 loadingmsg:'loadding....',
//預(yù)計高度,用來判斷彈出的上下方位 yjwidth:360,
//預(yù)計寬度,用來判斷彈出的左右方位 yjheight:60,
//寫在彈出框內(nèi)的方法,xml為ajaxurl返回的數(shù)據(jù) createhtml:function(xml){
return "
"+xml+"
";
}
};
4.頁面代碼
1)樣式表及js
2)覆蓋默認配置項
//所有的a都支持彈窗,獲取數(shù)據(jù)的url改為/data.php ,等待提示改為:等待中
$('a').each(function(){$(this).jspop({'ajaxurl':'/data.php','loadingmsg':'等待中..'});});
歡迎提供意見和建議。郵箱:[email protected]
