jquery.sobox 經典版彈窗控制項

來源:互聯網
上載者:User

標籤:

sobox 是一款非常實用的,基於 jQuery 的彈窗控制項。
功能非常完整,而代碼量又非常少(壓縮完僅8k不到)的一款彈窗控制項,
如果你熟悉ext的彈窗控制項,那麼sobox的使用對你來說應該是愉悅而完全沒有壓力。

效果預覽

引入sobox檔案
  1. <link type="text/css" rel="stylesheet" media="all" href="style.css" />
  2. <script type="text/javascript" src="jquery1.9.1.min.js"></script>
  3. <script type="text/javascript" src="jquery.sobox.js"></script>
複製使用方法
  1. $(‘.a-tip‘).click(function () {
  2.     $.sobox.tip({
  3.         content: ‘愛看不看,上面提示一下~‘
  4.     });
  5.     return false;
  6. });
複製sobox 基本參數
  1. //通用方法
  2. $.sobox.pop({
  3.      /* 彈出類型及型別參數 */
  4.     type : ‘content‘, // 彈窗內容模式:‘content‘,‘target‘,‘ajax‘,‘iframe‘,每個模式分別對應每個參量
  5.     target : null, // target方式,target目標,如 ‘.detail‘,‘#contbox‘
  6.     content : null, // content方式,支援html
  7.     iframe : null, // iframe方式,值為iframe目標頁連結,如:http:// www.baidu.com/
  8.     ajax:{url:null,data:null,callback:function(){}}, // ajax事件
  9.  
  10.      /* 位置資訊 */
  11.     posType:‘center‘, // ‘center,win,doc,tc,bc‘ 位置類型,置中 / 距window頂部 / 距離doucment頂部定 / top水平置中 / bottom水平置中,預設置中
  12.     pos:[0,0], // [x,y] 距離document左上方座標,set模式使用
  13.     offset:[0,0], // [x,y] 彈窗相對本來設定位置位移量,center模式只改變y軸
  14.  
  15.      /* 自訂參數 */
  16.     cls : null, // 添加自訂類名
  17.     width:360,height:null, // 寬高屬性,iframe模式下,height為iframe高度
  18.     defaultShow:true, // 直接顯示pop
  19.     visibility:true, // 預設pop執行後顯示(用於部分複雜處理情境)
  20.     title : ‘提示‘, // 預設標題
  21.     showTitle:true, // 標題列隱藏:預設顯示
  22.     showMask : true, // 顯示遮罩
  23.     drag :true, // 是否可拖動
  24.     maskClick : true, // 點擊背景關閉內容
  25.     btn : [], // {cls:,text‘確定‘,link:,removePop: true,callback:}
  26.  
  27.      /* 返回事件 */
  28.     beforePop:function(){}, // 彈窗開啟之前callback事件
  29.     onPop: function(){}, // 頁面開啟callback事件
  30.     closePop: function(){} // 點擊標題關閉按鈕返回事件
  31. });
  32.  
  33. btn參數說明:
  34.  
  35. 預設每個btn元素由一個.a-sopop-btn 的a元素內建一個.s-sopop-btn span元素組成,
  36.  
  37. {
  38.      cls:null, // 添加類名
  39.      text:‘確定‘, // 預設按鈕文字
  40.      link:‘#‘, // 為a添加連結,添加連結後,按鈕返回連結指向地址
  41.      removePop: true, // 預設點擊按鈕關閉彈出層
  42.      callback:function (removePop){} // 返回事件
  43. }
複製

 

下載

 

jquery.sobox 經典版彈窗控制項

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.