We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

1man on 10/29/07


Tagged

javascript resize drag mootools


Versions (?)


Mootools Draggable / Resize Example


Published in: JavaScript 


Very simple drag and resize function.

  1. function resizeDrag(){
  2. //create an array of elements with class 'drag'
  3. var draggables = $ES('.drag');
  4. //For each of the above elements run this function(pass in the selected function el)
  5. draggables.each(function(el){
  6. //Make the element dragable. Draging starts on the element with class = handle
  7. el.makeDraggable({handle: el.getElementsBySelector('.handle')[0]});
  8. //Make the element resizable. Resizing starts on the element with class = resize
  9. el.makeResizable({handle: el.getElementsBySelector('.resize')[0]});
  10. });
  11. }

Report this snippet 

You need to login to post a comment.