码迷,mamicode.com
首页 > 其他好文 > 详细

EasyUI基础入门之Resiable(可缩放)

时间:2015-01-14 19:40:41      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:

        easyui的base插件学习已经进行到Resizable(可缩放)了。照旧看看easyui官网的API。

Resiable

      正如其字面意思一样(可伸缩),resiable主要是将一些html元素扩展为可伸缩的,panel、window等,不信的话查阅easyui载入器源代码就能够知道啦!(window是依赖于resizable的)还是以官网的描写叙述来说。

      覆盖默认$.fn.resizable.defaults.

属性

名称 类型 描写叙述信息 默认值
disabled boolean 假设为true则表示能够伸缩 false
handles string 暗示了伸缩的方向,‘n‘表明向北方伸缩,‘e‘则表示向东边 n,e,s,w,ne,se,sw,nw,all
minWidth number 伸缩之后的最小宽度 10
minHeight number 缩放之后的最小高度 10
maxWidth number 缩放之后的最大宽度 10000    
maxHeight number 缩放之后的最小宽度 10000
edge number 缩放的宽度,距离边缘多少能够缩放 5

事件

名称 參数 描写叙述信息
onStartResize e 当開始缩放的时候会被触发                                                 
onResize e 调整大小的期间触发,当返回false,DOM元素不会起到实际的缩放作用
onStopResize e 停止缩放的时候触发的操作

方法

名称 參数 描写叙述信息
options none 返回resiable參数对象
enable none 能够调整大小
disable none 不能调整大小

使用方式

        1、通过html标记创建:

<div class="easyui-resizable" style="width:100px;height:100px;border:1px solid #ccc;"
        data-options="maxWidth:800,maxHeight:600">
</div>

         2、使用js脚本创建:
<div id="rr" style="width:100px;height:100px;border:1px solid #ccc;"></div>
$('#rr').resizable({
    maxWidth:800,
    maxHeight:600
});

Demo

        相同官方站点的Demo,一看就懂!


<!DOCTYPE html>
<html> <head>
    <meta charset="UTF-8">
    <title>Basic Draggable - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.6/themes/metro/easyui.css">
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.6/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="jquery-easyui-1.3.6/demo/demo.css">
    <script type="text/javascript" src="jquery-easyui-1.3.6/jquery.min.js"></script>
    <script type="text/javascript" src="jquery-easyui-1.3.6/jquery.easyui.min.js"></script>
</head>
<body>
    <center>

        <div class="easyui-resizable" data-options="minWidth:50,minHeight:50" style="border: 2px solid #C0C0C0;
        -moz-border-radius: 10px;
        -webkit-border-radius: 10px;
        border-radius: 10px;
        position: relative;
        padding: 5px;
        background: #FFF;
        height:300px;
        width:300px;                                                                           
        z-index: 2;">
            <div style="padding:20px">Resize Me</div>
        </div>
    </center>
    <script>
    </script>
</body>
</html>


          好了,就这样了,我也懒得去贴网址了!

          独立网站:liangtao.sinaapp.com/?p=200

EasyUI基础入门之Resiable(可缩放)

标签:

原文地址:http://www.cnblogs.com/mengfanrong/p/4224604.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!