您好,登錄后才能下訂單哦!
sobox 是一款非常實(shí)用的,基于 jQuery 的彈窗控件。
功能非常完整,而代碼量又非常少(壓縮完僅8k不到)的一款彈窗控件,
如果你熟悉ext的彈窗控件,那么sobox的使用對(duì)你來(lái)說(shuō)應(yīng)該是愉悅而完全沒(méi)有壓力。
<link type="text/css" rel="stylesheet" media="all" href="style.css" />
<script type="text/javascript" src="jquery1.9.1.min.js"></script>
<script type="text/javascript" src="jquery.sobox.js"></script>
$('.a-tip').click(function () {
$.sobox.tip({
content: '愛(ài)看不看,上面提示一下~'
});
return false;
});
//通用方法
$.sobox.pop({
/* 彈出類(lèi)型及類(lèi)型參數(shù) */
type : 'content', // 彈窗內(nèi)容模式:'content','target','ajax','iframe',每個(gè)模式分別對(duì)應(yīng)每個(gè)參量
target : null, // target方式,target目標(biāo),如 '.detail','#contbox'
content : null, // content方式,支持html
iframe : null, // iframe方式,值為iframe目標(biāo)頁(yè)鏈接,如:http:// www.baidu.com/
ajax:{url:null,data:null,callback:function(){}}, // ajax事件
/* 位置信息 */
posType:'center', // 'center,win,doc,tc,bc' 位置類(lèi)型,居中 / 距window頂部 / 距離doucment頂部定 / top水平居中 / bottom水平居中,默認(rèn)居中
pos:[0,0], // [x,y] 距離document左上角坐標(biāo),set模式使用
offset:[0,0], // [x,y] 彈窗相對(duì)本來(lái)設(shè)定位置偏移量,center模式只改變y軸
/* 自定義參數(shù) */
cls : null, // 添加自定義類(lèi)名
width:360,height:null, // 寬高屬性,iframe模式下,height為iframe高度
defaultShow:true, // 直接顯示pop
visibility:true, // 默認(rèn)pop執(zhí)行后顯示(用于部分復(fù)雜處理場(chǎng)景)
title : '提示', // 默認(rèn)標(biāo)題
showTitle:true, // 標(biāo)題欄隱藏:默認(rèn)顯示
showMask : true, // 顯示遮罩
drag :true, // 是否可拖動(dòng)
maskClick : true, // 點(diǎn)擊背景關(guān)閉內(nèi)容
btn : [], // {cls:,text'確定',link:,removePop: true,callback:}
/* 返回事件 */
beforePop:function(){}, // 彈窗打開(kāi)之前callback事件
onPop: function(){}, // 頁(yè)面打開(kāi)callback事件
closePop: function(){} // 點(diǎn)擊標(biāo)題關(guān)閉按鈕返回事件
});
btn參數(shù)說(shuō)明:
默認(rèn)每個(gè)btn元素由一個(gè).a-sopop-btn 的a元素內(nèi)置一個(gè).s-sopop-btn span元素組成,
{
cls:null, // 添加類(lèi)名
text:'確定', // 默認(rèn)按鈕文字
link:'#', // 為a添加鏈接,添加鏈接后,按鈕返回鏈接指向地址
removePop: true, // 默認(rèn)點(diǎn)擊按鈕關(guān)閉彈出層
callback:function (removePop){} // 返回事件
}
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。