basic.js
上传用户:shuoshiled
上传日期:2018-01-28
资源大小:10124k
文件大小:2k
源码类别:

中间件编程

开发平台:

JavaScript

  1. /*!  * Ext JS Library 3.0.0  * Copyright(c) 2006-2009 Ext JS, LLC  * licensing@extjs.com  * http://www.extjs.com/license  */ var ResizableExample = {
  2.     init : function(){
  3.         
  4.         var basic = new Ext.Resizable('basic', {
  5.                 width: 200,
  6.                 height: 100,
  7.                 minWidth:100,
  8.                 minHeight:50
  9.         });
  10.         
  11.         var animated = new Ext.Resizable('animated', {
  12.                 width: 200,
  13.                 pinned: true,
  14.                 height: 100,
  15.                 minWidth:100,
  16.                 minHeight:50,
  17.                 animate:true,
  18.                 easing: 'backIn',
  19.                 duration:.6
  20.         });
  21.         
  22.         var wrapped = new Ext.Resizable('wrapped', {
  23.             wrap:true,
  24.             pinned:true,
  25.             minWidth:50,
  26.             minHeight: 50,
  27.             preserveRatio: true
  28.         });
  29.         
  30.         var transparent = new Ext.Resizable('transparent', {
  31.             wrap:true,
  32.             minWidth:50,
  33.             minHeight: 50,
  34.             preserveRatio: true,
  35.             transparent:true
  36.         });
  37.         
  38.         var custom = new Ext.Resizable('custom', {
  39.             wrap:true,
  40.             pinned:true,
  41.             minWidth:50,
  42.             minHeight: 50,
  43.             preserveRatio: true,
  44.             handles: 'all',
  45.             draggable:true,
  46.             dynamic:true
  47.         });
  48.         var customEl = custom.getEl();
  49.         // move to the body to prevent overlap on my blog
  50.         document.body.insertBefore(customEl.dom, document.body.firstChild);
  51.         
  52.         customEl.on('dblclick', function(){
  53.             customEl.hide(true);
  54.         });
  55.         customEl.hide();
  56.         
  57.         Ext.get('showMe').on('click', function(){
  58.             customEl.center();
  59.             customEl.show(true);
  60.         });
  61.         
  62.         var dwrapped = new Ext.Resizable('dwrapped', {
  63.             wrap:true,
  64.             pinned:true,
  65.             width:450,
  66.             height:150,
  67.             minWidth:200,
  68.             minHeight: 50,
  69.             dynamic: true
  70.         });
  71.         
  72.         var snap = new Ext.Resizable('snap', {
  73.             pinned:true,
  74.             width:250,
  75.             height:100,
  76.             handles: 'e',
  77.             widthIncrement:50,
  78.             minWidth: 50,
  79.             dynamic: true
  80.         });
  81.     }
  82. };
  83. Ext.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true);