X-Git-Url: http://git.cyclocoop.org/?p=lhc%2Fweb%2Fclavette_www.git;a=blobdiff_plain;f=www%2Fplugins%2Fcrayons%2Fjs%2Fresizehandle.js;fp=www%2Fplugins%2Fcrayons%2Fjs%2Fresizehandle.js;h=686647f86023717e320897356ff7875eab69319c;hp=0000000000000000000000000000000000000000;hb=39f8b2ffa1fd0a3c67d6c74ed0fee9af296ccbb8;hpb=65eb21b34b55f850024ccda121bb96c73be4309f diff --git a/www/plugins/crayons/js/resizehandle.js b/www/plugins/crayons/js/resizehandle.js new file mode 100644 index 0000000..686647f --- /dev/null +++ b/www/plugins/crayons/js/resizehandle.js @@ -0,0 +1,32 @@ +(function($){ +/* + * resizehandle.js (c) Fil 2007-2011, plugin pour jQuery + * @ http://www.jquery.info/spip.php?article44 + * Distribue sous licence GNU/LGPL et MIT + */ +$.fn.resizehandle = function() { + return this.each(function() { + var me = $(this); + me.after( + $('
') + .css({height:'16px',width:Math.max(me.width()-4,10)}) // bug MSIE si 100% + .bind('mousedown', function(e) { + var h = me.height(); + var y = e.clientY; + var moveHandler = function(e) { + me + .height(Math.max(20, e.clientY + h - y)); + }; + var upHandler = function(e) { + $('html') + .unbind('mousemove',moveHandler) + .unbind('mouseup',upHandler); + }; + $('html') + .bind('mousemove', moveHandler) + .bind('mouseup', upHandler); + }) + ); + }); +}; +})(jQuery);