·概述 resizable插件可以让选中的元素具有改变尺寸的功能。

官方示例地址:http://jqueryui.com/demos/resizable/

所有的事件回调函数都有两个参数:event和ui,浏览器自有event对象,和经过封装的ui对象

ui.helper - 表示当前被改变尺寸的元素的JQuery对象

ui.originalPosition - 表示未改变尺寸之前元素的位置{top,left}

ui.originalSize - 表示未改变尺寸之前元素的大小{width,height}

ui.position - 表示当前被改变尺寸的元素的坐标值对象{top,left}

ui.size - 表示当前被改变尺寸的元素的大小值对象{width,height}

·参数(参数名 : 参数类型 : 默认值)

alsoResize : Selector, jQuery, ElementDefault : false

当调整元素大小时,同步改变另一个(或一组)元素的大小。

初始:$('.selector').resizable({ alsoResize: '.other' });

获取:var alsoResize = $('.selector').resizable('option', 'alsoResize');

设置:$('.selector').resizable('option', 'alsoResize', '.other');

animate : Boolean : false

在调整元素大小结束之后是否显示动画

初始:$('.selector').resizable({ animate: true });

获取:var animate = $('.selector').resizable('option', 'animate');

设置:$('.selector').resizable('option', 'animate', true);

animateDuration : Integer, String : 'slow'

动画效果的持续时间。(单位:毫秒)可选值:'slow', 'normal', 'fast'

初始:$('.selector').resizable({ animateDuration: 500 });

获取:var animateDuration = $('.selector').resizable('option', 'animateDuration');

设置:$('.selector').resizable('option', 'animateDuration', 500);

animateEasing : String : 'swing'   选择何种动画效果。

初始:$('.selector').resizable({ animateEasing: 'swing' });

获取:var animateEasing = $('.selector').resizable('option', 'animateEasing');

设置:$('.selector').resizable('option', 'animateEasing', 'swing');

aspectRatio : Boolean, Float : false

如果设置为true,则元素的可调整尺寸受原来大小的限制。例如:9 / 16, or 0.5

初始:$('.selector').resizable({ aspectRatio: .75 });

获取:var aspectRatio = $('.selector').resizable('option', 'aspectRatio');

设置:$('.selector').resizable('option', 'aspectRatio', .75);

autoHide : Boolean : false

如果设置为true,则默认隐藏掉可调整大小的手柄,除非鼠标移至元素上。

初始:$('.selector').resizable({ autoHide: true });

获取:var autoHide = $('.selector').resizable('option', 'autoHide');

设置:$('.selector').resizable('option', 'autoHide', true);

cancel : Selector : ':input,option'

阻止resizable插件加载在与你匹配的元素上。

初始:$('.selector').resizable({ cancel: ':input,option' });

获取:var cancel = $('.selector').resizable('option', 'cancel');

设置:$('.selector').resizable('option', 'cancel', ':input,option');

containment : String, Element, Selector : false

控制元素只能在某一个元素的大小之内改变。允许值:'parent', 'document', DOM元素, 或一个选择器.

初始:$('.selector').resizable({ containment: 'parent' });

获取:var containment = $('.selector').resizable('option', 'containment');

设置:$('.selector').resizable('option', 'containment', 'parent');

delay : Integer : 0

以毫秒为单位,当发生鼠标点击手柄改变大小,延迟多少毫秒后才激活事件。

初始:$('.selector').resizable({ delay: 20 });

获取:var delay = $('.selector').resizable('option', 'delay');

设置:$('.selector').resizable('option', 'delay', 20);

distance : Integer : 1

以像素为单位,当发生鼠标点击手柄改变大小,延迟多少像素后才激活事件。

初始:$('.selector').resizable({ distance: 20 });

获取:var distance = $('.selector').resizable('option', 'distance');

设置:$('.selector').resizable('option', 'distance', 20);

ghost : Boolean : false

如果设置为true,则在调整元素大小时,有一个半透明的辅助对象显示。

初始:$('.selector').resizable({ ghost: true });

获取:var grid = $('.selector').resizable('option', 'ghost');

设置:$('.selector').resizable('option', 'ghost', true);

grid : Array : false

设置元素调整的大小随网格变化,允许的数据为:{x,y}

初始:$('.selector').resizable({ grid: [50, 50] });

获取:var grid = $('.selector').resizable('option', 'grid');

设置:$('.selector').resizable('option', 'grid', [50, 50]);

handles : String, Object : 'e, s, se'

设置resizable插件允许生成在元素的哪个边上,可选值:n, e, s, w, ne, se, sw, nw, all

初始:$('.selector').resizable({ handles: 'n, e, s, w' });

获取:var handles = $('.selector').resizable('option', 'handles');

设置:$('.selector').resizable('option', 'handles', 'n, e, s, w');

helper : String : false

一个CSS类,当调整元素大小时,将被添加到辅助元素中,一但调整结束则恢复正常。

初始:$('.selector').resizable({ helper: 'ui-state-highlight' });   获取:var helper = $('.selector').resizable('option', 'helper');   设置:$('.selector').resizable('option', 'helper', 'ui-state-highlight');

maxHeight : Integer : null

设置允许元素调整的最大高度。

初始:$('.selector').resizable({ maxHeight: 300 });

获取:var maxHeight = $('.selector').resizable('option', 'maxHeight');

设置:$('.selector').resizable('option', 'maxHeight', 300);

maxWidth : Integer : null

设置允许元素调整的最大宽度。

初始:$('.selector').resizable({ maxWidth: 250 });

获取:var maxWidth = $('.selector').resizable('option', 'maxWidth');

设置:$('.selector').resizable('option', 'maxWidth', 250);

minHeight : Integer : 10

设置允许元素调整的最小高度。

初始:$('.selector').resizable({ minHeight: 150 });

获取:var minHeight = $('.selector').resizable('option', 'minHeight');

设置:$('.selector').resizable('option', 'minHeight', 150);

minWidth : Integer : 10

设置允许元素调整的最小宽度。

初始:$('.selector').resizable({ minWidth: 75 });

获取:var minWidth = $('.selector').resizable('option', 'minWidth');

设置:$('.selector').resizable('option', 'minWidth', 75);

·事件

start

当元素调整动作开始时触发。

初始:$('.selector').resizable({ start: function(event, ui) { ... } });

绑定:$('.selector').bind('resizestart', function(event, ui) { ... });

resize

当元素调整动作过程中触发。

初始:$('.selector').resizable({ resize: function(event, ui) { ... } });

绑定:$('.selector').bind('resize', function(event, ui) { ... });

stop

当元素调整动作结束时触发。

初始:$('.selector').resizable({ stop: function(event, ui) { ... } });

绑定:$('.selector').bind('resizestop', function(event, ui) { ... });

·方法

destory

从元素中移除拖拽功能。

用法:.droppable( 'destroy' )

disable

禁用元素的拖拽功能。

用法:.droppable( 'disable' )

enable

启用元素的拖拽功能。

用法:.droppable( 'enable' )

option

获取或设置元素的参数。

用法:.droppable( 'option' , optionName , [value] )

------------------------------------------------------------------------------------------------------------

  1. 概述
  2. resizable插件可以让选中的元素具有改变尺寸的功能。
  3. 官方示例地址:http://jqueryui.com/demos/resizable/
  4. 所有的事件回调函数都有两个参数:event和ui,浏览器自有event对象,和经过封装的ui对象
  5. ui.helper - 表示当前被改变尺寸的元素的JQuery对象
  6. ui.originalPosition - 表示未改变尺寸之前元素的位置{top,left}
  7. ui.originalSize - 表示未改变尺寸之前元素的大小{width,height}
  8. ui.position - 表示当前被改变尺寸的元素的坐标值对象{top,left}
  9. ui.size - 表示当前被改变尺寸的元素的大小值对象{width,height}
  10. ·参数(参数名 : 参数类型 : 默认值)
  11. alsoResize : Selector, jQuery, ElementDefault : false
  12. 当调整元素大小时,同步改变另一个(或一组)元素的大小。
  13. 初始:$('.selector').resizable({ alsoResize: '.other' });
  14. 获取:var alsoResize = $('.selector').resizable('option', 'alsoResize');
  15. 设置:$('.selector').resizable('option', 'alsoResize', '.other');
  16. animate : Boolean : false
  17. 在调整元素大小结束之后是否显示动画
  18. 初始:$('.selector').resizable({ animate: true });
  19. 获取:var animate = $('.selector').resizable('option', 'animate');
  20. 设置:$('.selector').resizable('option', 'animate', true);
  21. animateDuration : Integer, String : 'slow'
  22. 动画效果的持续时间。(单位:毫秒)可选值:'slow', 'normal', 'fast'
  23. 初始:$('.selector').resizable({ animateDuration: 500 });
  24. 获取:var animateDuration = $('.selector').resizable('option', 'animateDuration');
  25. 设置:$('.selector').resizable('option', 'animateDuration', 500);
  26. animateEasing : String : 'swing'
  27. 选择何种动画效果。
  28. 初始:$('.selector').resizable({ animateEasing: 'swing' });
  29. 获取:var animateEasing = $('.selector').resizable('option', 'animateEasing');
  30. 设置:$('.selector').resizable('option', 'animateEasing', 'swing');
  31. aspectRatio : Boolean, Float : false
  32. 如果设置为true,则元素的可调整尺寸受原来大小的限制。例如:9 / 16, or 0.5
  33. 初始:$('.selector').resizable({ aspectRatio: .75 });
  34. 获取:var aspectRatio = $('.selector').resizable('option', 'aspectRatio');
  35. 设置:$('.selector').resizable('option', 'aspectRatio', .75);
  36. autoHide : Boolean : false
  37. 如果设置为true,则默认隐藏掉可调整大小的手柄,除非鼠标移至元素上。
  38. 初始:$('.selector').resizable({ autoHide: true });
  39. 获取:var autoHide = $('.selector').resizable('option', 'autoHide');
  40. 设置:$('.selector').resizable('option', 'autoHide', true);
  41. cancel : Selector : ':input,option'
  42. 阻止resizable插件加载在与你匹配的元素上。
  43. 初始:$('.selector').resizable({ cancel: ':input,option' });
  44. 获取:var cancel = $('.selector').resizable('option', 'cancel');
  45. 设置:$('.selector').resizable('option', 'cancel', ':input,option');
  46. containment : String, Element, Selector : false
  47. 控制元素只能在某一个元素的大小之内改变。允许值:'parent', 'document', DOM元素, 或一个选择器.
  48. 初始:$('.selector').resizable({ containment: 'parent' });
  49. 获取:var containment = $('.selector').resizable('option', 'containment');
  50. 设置:$('.selector').resizable('option', 'containment', 'parent');
  51. delay : Integer : 0
  52. 以毫秒为单位,当发生鼠标点击手柄改变大小,延迟多少毫秒后才激活事件。
  53. 初始:$('.selector').resizable({ delay: 20 });
  54. 获取:var delay = $('.selector').resizable('option', 'delay');
  55. 设置:$('.selector').resizable('option', 'delay', 20);
  56. distance : Integer : 1
  57. 以像素为单位,当发生鼠标点击手柄改变大小,延迟多少像素后才激活事件。
  58. 初始:$('.selector').resizable({ distance: 20 });
  59. 获取:var distance = $('.selector').resizable('option', 'distance');
  60. 设置:$('.selector').resizable('option', 'distance', 20);
  61. ghost : Boolean : false
  62. 如果设置为true,则在调整元素大小时,有一个半透明的辅助对象显示。
  63. 初始:$('.selector').resizable({ ghost: true });
  64. 获取:var grid = $('.selector').resizable('option', 'ghost');
  65. 设置:$('.selector').resizable('option', 'ghost', true);
  66. grid : Array : false
  67. 设置元素调整的大小随网格变化,允许的数据为:{x,y}
  68. 初始:$('.selector').resizable({ grid: [50, 50] });
  69. 获取:var grid = $('.selector').resizable('option', 'grid');
  70. 设置:$('.selector').resizable('option', 'grid', [50, 50]);
  71. handles : String, Object : 'e, s, se'
  72. 设置resizable插件允许生成在元素的哪个边上,可选值:n, e, s, w, ne, se, sw, nw, all
  73. 初始:$('.selector').resizable({ handles: 'n, e, s, w' });
  74. 获取:var handles = $('.selector').resizable('option', 'handles');
  75. 设置:$('.selector').resizable('option', 'handles', 'n, e, s, w');
  76. helper : String : false
  77. 一个CSS类,当调整元素大小时,将被添加到辅助元素中,一但调整结束则恢复正常。
  78. 初始:$('.selector').resizable({ helper: 'ui-state-highlight' });
  79. 获取:var helper = $('.selector').resizable('option', 'helper');
  80. 设置:$('.selector').resizable('option', 'helper', 'ui-state-highlight');
  81. maxHeight : Integer : null
  82. 设置允许元素调整的最大高度。
  83. 初始:$('.selector').resizable({ maxHeight: 300 });
  84. 获取:var maxHeight = $('.selector').resizable('option', 'maxHeight');
  85. 设置:$('.selector').resizable('option', 'maxHeight', 300);
  86. maxWidth : Integer : null
  87. 设置允许元素调整的最大宽度。
  88. 初始:$('.selector').resizable({ maxWidth: 250 });
  89. 获取:var maxWidth = $('.selector').resizable('option', 'maxWidth');
  90. 设置:$('.selector').resizable('option', 'maxWidth', 250);
  91. minHeight : Integer : 10
  92. 设置允许元素调整的最小高度。
  93. 初始:$('.selector').resizable({ minHeight: 150 });
  94. 获取:var minHeight = $('.selector').resizable('option', 'minHeight');
  95. 设置:$('.selector').resizable('option', 'minHeight', 150);
  96. minWidth : Integer : 10
  97. 设置允许元素调整的最小宽度。
  98. 初始:$('.selector').resizable({ minWidth: 75 });
  99. 获取:var minWidth = $('.selector').resizable('option', 'minWidth');
  100. 设置:$('.selector').resizable('option', 'minWidth', 75);
  101. ·事件
  102. start
  103. 当元素调整动作开始时触发。
  104. 初始:$('.selector').resizable({ start: function(event, ui) { ... } });
  105. 绑定:$('.selector').bind('resizestart', function(event, ui) { ... });
  106. resize
  107. 当元素调整动作过程中触发。
  108. 初始:$('.selector').resizable({ resize: function(event, ui) { ... } });
  109. 绑定:$('.selector').bind('resize', function(event, ui) { ... });
  110. stop
  111. 当元素调整动作结束时触发。
  112. 初始:$('.selector').resizable({ stop: function(event, ui) { ... } });
  113. 绑定:$('.selector').bind('resizestop', function(event, ui) { ... });
  114. ·方法
  115. destory
  116. 从元素中移除拖拽功能。
  117. 用法:.droppable( 'destroy' )
  118. disable
  119. 禁用元素的拖拽功能。
  120. 用法:.droppable( 'disable' )
  121. enable
  122. 启用元素的拖拽功能。
  123. 用法:.droppable( 'enable' )
  124. option
  125. 获取或设置元素的参数。
  126. 用法:.droppable( 'option' , optionName , [value] )


JQuery UI - resizable的更多相关文章

  1. jQuery UI resizable使用注意事项、实时等比例拉伸及你不知道的技巧

    这篇文章总结的是我在使用resizable插件的过程中,遇到的问题及变通应用的奇思妙想. 一.resizable使用注意事项 以下是我在jsfiddle上写的测试demo:http://jsfiddl ...

  2. JQuery UI - resizable调整区域大小

    JQuery UI - resizable   ·概述 resizable插件可以让选中的元素具有改变尺寸的功能. 官方示例地址:http://jqueryui.com/demos/resizable ...

  3. 解决 jQuery.UI.Resizable aspectRatio在init后无法重新设置

    一.背景  在jQuery1.9.x版本之前,存在aspectRatio在Resizable方法init之后,无法再次修改aspectRatio的boolean值. 二.解决方案 // 用于fix j ...

  4. 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.6.Dialog控件

    习惯上,我们播放一条简短的信息,或向浏览者询问一个问题,都会用到dialog. 创建一个基本的dialog 使用dialog 选项 形式 启用内置动画 给dialog添加按钮 使用dialog回调函数 ...

  5. jquery ui的css设计

    jquery ui 是当前最强大的UI库之一,其两大卖点是对IE6的良好支持与换肤功能.为了构建avalon ui,今天起我将投入一部分精力来研究时下最流行的几个CSS框架.它是首当其冲. jquer ...

  6. jquery ui 怎么实现tab标签切换效果

    1.效果图 2.HTML 代码 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> &l ...

  7. jQuery UI与jQuery easyUI的冲突解决办法

    jQuery UI与jQuery easyUI都是基于jQuery开发的.难免里面会有些方法名冲突! 因此对jQuery.easyui其中的两个方法名:resizable 和 draggable进行替 ...

  8. Jquery UI

    jQuery UI简介 jQuery UI包含了许多维持状态的小部件(Widget),因此,它与典型的 jQuery 插件使用模式略有不同.所有的 jQuery UI 小部件(Widget)使用相同的 ...

  9. JQuery UI dialog 弹窗实例及参数说明

    按钮代码: <a id="suprise" style="margin-left: 0.5em;cursor:pointer;">点我会有惊喜< ...

随机推荐

  1. Struts1应用、实现简单计算器、使用DispatchAction、显示友好的报错信息、使用动态Form简化开发

    实现简单的支持加.减.乘.除的计算器 复制一份Struts1Demo修改:Struts1Calc 方案1: Struts1Calc 创建ActionForm: CalcForm extends Act ...

  2. MySQL 存储过程探秘

    关于存储过程的优点,本文不再阐述.这里只是对创建存储过程时可能遇到的问题做一下简单的分析. 必备基础 这里说的基础,是相关于如何创建一个存储过程的. DELIMITER:分隔符,定界符. 作用就是:作 ...

  3. Dynamics CRM 窗体Javascript获取时间字段值的准确转换

    本篇延续上篇博文继续时间字段的转化实验,本篇讲的是在窗体Javascript中获取及更新时间字段的具体写法,是否需要进行时制的转化,先看下通过ODATA取到的时间字段值 当然取出来看格式就知道是不能直 ...

  4. 【OpenGL】详解第一个OpenGL程序

    写在前面 OpenGL能做的事情太多了!很多程序也看起来很复杂.很多人感觉OpenGL晦涩难懂,原因大多是被OpenGL里面各种语句搞得头大,一会gen一下,一会bind一下,一会又active一下. ...

  5. androidpn-server笔记及BUG修改

    上篇讲了androidpn的client端,这篇该讲一下我使用androidpn-server端的笔记了. 这里我使用的androidpn是tomcat版的,由不知哪位大神移植并修复了部分bug的版本 ...

  6. Sql Server服务远程过程调用失败

    由于开发系统,需要vs版本统一,于是经过了昨天一整天艰苦卓绝的斗争,小编终于成功的写在了13版本的vs,重新装上了12版本的vs,本来想着,12版本的vs搭建成功了,就赶快搭建框架,然后敲例子,可是天 ...

  7. Java进阶(三十四)Integer与int的种种比较你知道多少?

    Java进阶(三十四)Integer与int的种种比较你知道多少? 前言 如果面试官问Integer与int的区别:估计大多数人只会说到两点:Ingeter是int的包装类,注意是一个类:int的初值 ...

  8. Get and Post(Unity3D开发之六)

    猴子原创,欢迎转载.转载请注明: 转载自Cocos2D开发网–Cocos2Dev.com,谢谢! 原文地址: http://www.cocos2dev.com/?p=565 unity3d中的www直 ...

  9. (六十八)使用XMPPFramework登录

    按照XMPPFramework的官方样例,应该把登录代码放置在AppDelegate中,并且让注销成为私有方法. XMPPFramework进行登录的步骤如下: ①连接主机,并且发送JID ②如果连接 ...

  10. 在CSDN开通博客专栏后如何发布文章(图文)

    今天打开电脑登上CSDN发现自己授予了专栏勋章,有必要了解如何在专栏发布文章. 很感谢已经有前辈给出了图文教程,此文章转载自博客:http://blog.csdn.net/upi2u/article/ ...