jQuery easyui官方文檔翻譯 - 基礎總覽

jQuery easyui官方文檔翻譯web版:http://easydoc.cloudfoundry.com/doc/easyui/1.2.5/

Documentation

Each component of easyui has properties, methods and events. Users can extend them easily.jquery

每一個easyui組件都有特性(property)、方法(method)和事件(event),用戶能夠很容易地擴展它們。web

屬性 Properties

The properties is defined in jQuery.fn.{plugin}.defaults. For example, the dialog's properties is defined in jQuery.fn.dialog.defaults.函數

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

事件 Events

The events(callback functions) is defined in jQuery.fn.{plugin}.defaults also.this

事件(回調函數)也在jQuery.fn.{plugin}.defaults裏定義。spa

方法 Methods

The calling method syntax: $('selector').plugin('method', parameter);翻譯

Where:code

  • selector is the jquery object selector.
  • plugin is the plugin name.
  • method is the existing method corresponding to the plugin.
  • parameter is the parameter object, can be a object, string, ...

調用方法的語法:$('selector').plugin('method', parameter);component

其中:orm

  • selector jquery對象選擇器.
  • plugin easyui組件名稱.
  • method 組件中的方法.
  • parameter 參數, 能夠是object, string, ...

The methods is defined in jQuery.fn.{plugin}.methods. Each method has two parameters: jq and param. The first parameter 'jq' is required, which refers to that jQuery object. The second parameter 'param' refers to the really parameter that pass through the method. For example, to extend a method named 'mymove' for the dialog component, the code looks like this:

方法在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. });  

Now you can call 'mymove' method to move the dialog to specified position:

如今你能夠調用'mymove'方法把dialog移動到一個指定的位置:

  1. $('#dd').dialog('mymove', {  
  2.     left: 200,  
  3.     top: 100  
  4. });  
相關文章
相關標籤/搜索