1.窗口最大化最小化以及拖动的resize方法

$(window).resize(function(){});

2.dom对象支持resize的方法

//监听div大小变化(function($,h,c){vara=$([]),e=$.resize=$.extend($.resize,{}),i,k="setTimeout",j="resize",d=j+"-special-event",b="delay",f="throttleWindow";e[b]=250;e[f]=true;$.event.special[j]={setup:function(){if(!e[f]&&this[k]){returnfalse;}varl=$(this);a=a.add(l);$.data(this,d,{w:l.width(),h:l.height()});if(a.length===1){g();}},teardown:function(){if(!e[f]&&this[k]){returnfalse;}varl=$(this);a=a.not(l);l.removeData(d);if(!a.length){clearTimeout(i);}},add:function(l){if(!e[f]&&this[k]){returnfalse;}varn;functionm(s,o,p){varq=$(this),r=$.data(this,d);r.w=o!==c?o:q.width();r.h=p!==c?p:q.height();n.apply(this,arguments);}if($.isFunction(l)){n=l;returnm;}else{n=l.handler;l.handler=m;}}};functiong(){i=h[k](function(){a.each(function(){varn=$(this),m=n.width(),l=n.height(),o=$.data(this,d);if(m!==o.w||l!==o.h){n.trigger(j,[o.w=m,o.h=l]);}});g();},e[b]);}})(jQuery,this);

调用:

$("#id").resize(function(){});