首页 技术 正文
技术 2022年11月12日
0 收藏 794 点赞 4,386 浏览 1420 个字

Resizable(调整大小)组件,easyui基础组件之中的一个。调整大小就是能够对元素能够拖着调整大小,这个组件不依赖于其它组件,使用比較简单,相关的属性、事件都

在样例中介绍了。

演示样例:

<!DOCTYPE html>
<html>
<head>
<title>jQuery Easy UI</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="easyui/jquery.min.js"></script>
<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js" ></script>
<link rel="stylesheet" type="text/css" href="easyui/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="easyui/themes/icon.css" />
<script>
$(function () {
$.fn.resizable.defaults.disabled = true;
$('#rr').resizable({
disabled : false, //设置为true的时候禁止调整
handles : 'e,s,se',//声明调整的方位:n:北 e:东 s:南 w:西 除此之外还有ne、se、sw、nw和all。
minWidth : 200,//默觉得10 调整大小的时候最小宽度
minHeight : 200,//默觉得10 调整
maxWidth : 600,//默觉得10000调整大小时默认最大宽度
maxHeight: 400,//默觉得10000调整大小时默认最大高度
edge : 10,//默认5 边框边缘触发大小(就是多大区域触发可拖拽边线)//通过浏览器控制台能够清晰的看到以下几个事件的触发时机以及触发次数
onStartResize : function (e) {
console.log('開始调整的时候触发!');
},
onResize : function (e) {
console.log('调整期间的时候触发!');
//return false;
},
onStopResize : function (e) {
console.log('停止调整的时候触发!');
},
});console.log($('#rr').resizable('options'));//返回对象属性$('#rr').resizable('disable'); //禁用调整功能
$('#rr').resizable('enable'); //启用调整功能
});
</script>
</head>
<body>
<div id="rr" style="width:100px;height:100px;border:1px solid black"></div>
</body>
</html>

点击下载源码

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,489
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,904
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,737
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,490
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,128
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,291