resizable

easyui的resizable用来设置元素为可变大小

<!DOCTYPE html>
<html>
<head>
<title>jQuery Easy UI</title>
<meta charset="UTF-8" />
<script type="text/javascript" src="C:/Users/秋萍/Desktop/easyui/jquery-easyui-1.5.1/jquery.min.js"></script>
<script type="text/javascript" src="C:/Users/秋萍/Desktop/easyui/jquery-easyui-1.5.1/jquery.easyui.min.js"></script>
<script type="text/javascript" src="C:/Users/秋萍/Desktop/easyui/jquery-easyui-1.5.1/locale/easyui-lang-zh_CN.js" ></script>
<link rel="stylesheet" type="text/css" href="C:/Users/秋萍/Desktop/easyui/jquery-easyui-1.5.1/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="C:/Users/秋萍/Desktop/easyui/jquery-easyui-1.5.1/themes/icon.css" />
<script type="text/javascript">
    $(function(){
        $.fn.resizable.defaults.disabled=true;
        $("#box1").resizable({
            disabled : false,//是否禁止
            maxWidth : 250,
            maxHeight :250,
            minWidth:20,
            minHeight :20,
            handles : "all",//调整的方向
            edge : 61,//边框边缘触发大小
            onStartResize : function(e){
                console.log("在开始改变大小是触发");
            },
            onResize : function(e){
                console.log("在调整大小期间触发");
            },
            onStopResize : function(e){
                console.log("在停止改变大小时触发");
                console.log($("#box1").resizable("options"));
                //$("#box1").resizable("enable");//
                //$("#box1").resizable("disable");设置禁止缩放
            }
        });
    });
</script>
</head>
<body>
<div id="box" class="easyui-resizable"
data-options="maxWidth:200,maxHeight:200"
style="width:100px;height:100px;border:1px solid #ccc;"></div>
<div id="box1"
style="width:100px;height:100px;border:1px solid #ccc;"></div>

</body>
</html>

 

转载于:https://www.cnblogs.com/m01qiuping/p/6486369.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值