/ Published in: JavaScript
Very simple drag and resize function.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function resizeDrag(){ //create an array of elements with class 'drag' var draggables = $ES('.drag'); //For each of the above elements run this function(pass in the selected function el) draggables.each(function(el){ //Make the element dragable. Draging starts on the element with class = handle el.makeDraggable({handle: el.getElementsBySelector('.handle')[0]}); //Make the element resizable. Resizing starts on the element with class = resize el.makeResizable({handle: el.getElementsBySelector('.resize')[0]}); }); }