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.

每个easyui组件都有特性(property)、方法(method)和事件(event),用户可以很容易地扩展它们。

属性 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里定义。

事件 Events

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

事件(回调函数)也在jQuery.fn.{plugin}.defaults里定义。

方法 Methods

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

Where:

  • 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);

其中:

  • 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. });  

转载于:https://my.oschina.net/noday/blog/50959

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值