jQuery EasyUI API 中文文檔 – 文檔

來源:互聯網
上載者:User

Documentation  文檔

風流涕淌 翻譯。不當之處,敬請指正。轉載請保留出處!

 

每個easyui組件都有特性(property)、方法(method)和事件(event),使用者可以很容易地擴充它們。

特性

特性在jQuery.fn.{plugin}.defaults裡定義。例如, dialog的特性在jQuery.fn.dialog.defaults裡定義。

事件

事件(回呼函數)也在jQuery.fn.{plugin}.defaults裡定義。

方法

方法在jQuery.fn.{plugin}.methods裡定義。每個方法有兩個參數:jq和param。第一個參數'jq'是必須的,它是指jQuery對象。第二個參數'param' 是指傳遞給方法的真正的參數。例如,給dialog組件擴充一個名叫'mymove' 的方法,代碼看起來就像這樣:

1. $.extend($.fn.dialog.methods, {   

2.     mymove: function(jq, newposition){   

3.         return jq.each(function(){   

4.             $(this).dialog('move', newposition);   

5.         });   

6.     }   

7. });  

現在你可以調用'mymove'方法把dialog移動到一個指定的位置:

1. $('#dd').dialog('mymove', {   

2.     left: 200,   

3.     top: 100   

4. });  

 

 

風流涕淌 翻譯。不當之處,敬請指正。轉載請保留出處!

 

聯繫我們

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