weebox 用法解析

來源:互聯網
上載者:User

使用前需包含以下jquery.js、bgiframe.js、weebox.js、wee.css檔案

 

基本用法舉例如下: $.weeboxs.open('#testbox', {title: 'hello world', width:400, height: 200});

 

$.weeboxs.open('The operation failed.',{
onopen:function(){alert('opened!');},
onclose:function(){alert('closed!');}, onok:function(){alert('ok');
$.weeboxs.close();} });

 

$.weeboxs.open('/modules/test/testsession.php', {contentType:'ajax'});

 

$.weeboxs.open('hello world');

 

$.weeboxs.open('The operation failed.',{type:'error'});

 

$.weeboxs.open('The operation failed.',{type:'wee'});

 

$.weeboxs.open('The operation failed.',{type:'success'});

 

$.weeboxs.open('The operation failed.',{type:'warning'});

 

$.weeboxs.open('Autoclosing in 5 seconds.', { timeout: 5 });

 

以下是預設選項:

boxid: null, //設定了此值只後,以後在開啟同樣boxid的彈窗時,前一個將被自動關閉

boxclass: null, //給彈窗設定其它的樣式,用此可以改變彈窗的樣式

type: 'dialog', //彈窗類型,目前有dialog,error,warning,success,wee,prompt,box六種

title: '', //彈窗標題

width: 0, //彈窗寬度,不設時,會自動依據內容改變大小

height: 0, //彈窗高度(注意是內容的高度,不是彈窗的高度)

timeout: 0, //自動關閉的秒數,設定此值後,視窗將自動關閉

draggable: true,//是否可以拖拽

modal: true, //是否顯示遮照

overlay: 75, //遮照透明度

focus: null, //彈窗開啟後,焦點移到什麼元素上,預設移到取消按鈕到

position: 'center',//彈窗開啟後的預設為中間,設定為element時,需要設定trager選項,

trigger: null, //顯示位置的參照元素,為一個元素id

showTitle: true,//是否顯示標題

showButton: true,//是否顯示按鈕,包括確定和取消

showCancel: true, //是否顯示取消按鈕

showOk: true, //是否顯示確定按鈕

okBtnName: '確定',//"確定"按鈕名稱

cancelBtnName: '取消',//"取消"按鈕名稱

contentType: 'text',//內容擷取方式,目前有三種text,selector,ajax

contentChange: false,//為selector時

clickClose: false, //點擊不在彈窗上時,是否關閉彈窗

zIndex: 999,//預設彈窗的層

animate: false,//效果顯示

onclose: null, //彈窗關閉時觸發的函數

onopen: null, //彈窗顯示前觸發的函數, 此時內容已經放入彈窗中,不過還沒有顯示出來

onok: null //點擊確定按鈕觸發的函數

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.