/** * jspceo (v2.0) - class: jqextend.js for jquery extend. * * * * ============================================================= * ------------------------- * drag: * ------------------------- * exp: dragobj.drag(obj); * eg.: $("#dialog").drag(".dialogtitle"); * * * ------------------------- * resize: * ------------------------- * exp: resizeobj.resize(obj); * eg.: $("#dialog").resize("#rbjiao"); * * * ============================================================= * * * * jqmodal - minimalist modaling with jquery * * copyright (c) 2007 brice burgess , http://www.iceburg.net * licensed under the mit license: * http://www.opensource.org/licenses/mit-license.php * * $version: 2007.08.17 +r11 * plug: drag, resize * **/ (function($){ $.fn.drag=function(h){ return i(this,h,'d'); }; $.fn.resize=function(h){ return i(this,h,'r'); }; $.jqdnr={ dnr:{}, e:0, drag:function(v){ if(m.k == 'd')e.css({left:m.x+v.pagex-m.px,top:m.y+v.pagey-m.py}); else e.css({width:math.max(v.pagex-m.px+m.w,0),height:math.max(v.pagey-m.py+m.h,0)}); return false; }, stop:function(){ e.css('opacity',m.o); $().unbind('mousemove',j.drag).unbind('mouseup',j.stop); } }; var j=$.jqdnr,m=j.dnr,e=j.e, i=function(e,h,k){ return e.each(function(){ h=(h)?$(h,e):e; h.bind('mousedown',{e:e,k:k},function(v){ var d=v.data,p={}; e=d.e; // attempt utilization of dimensions plugin to fix ie issues if(e.css('position') != 'relative'){ try{e.position(p);}catch(e){} } m={ x : p.left || f('left') || 0, y : p.top || f('top') || 0, w : f('width') || e[0].scrollwidth || 0, h : f('height') || e[0].scrollheight || 0, px : v.pagex, py : v.pagey, k : d.k, o : e.css('opacity') }; e.css({ opacity:0.9 }); $().mousemove($.jqdnr.drag).mouseup($.jqdnr.stop); return false; }); }); }, f=function(k){ return parseint(e.css(k)) || false; }; })(jquery);