1.  
  2. function init() {
  3. // BEGIN :: Window to drag
  4. var window1 = document.getElementById("Window1");
  5. var window1ToDrag = new YAHOO.util.DD(window1);
  6. window1ToDrag.setHandleElId("Window1DragHandle");
  7. // END :: Window to drag
  8.  
  9. // BEGIN :: Resizer
  10. var resizerElement = document.getElementById("Resizer1");
  11. var resizerToDrag = new YAHOO.util.DD(resizerElement);
  12. // END :: Resizer
  13. // BEGIN :: Event handlers
  14. resizerToDrag.onDrag = function(e) {
  15. var dragEl = this.getDragEl();
  16. var window = document.getElementById("Window1");
  17. var windowDragHandle = document.getElementById("Window1DragHandle");
  18. var body = document.getElementById("Window1Body");
  19.  
  20. var dragElTop = YAHOO.util.Dom.getStyle(dragEl, "top");
  21. var dragElLeft = YAHOO.util.Dom.getStyle(dragEl, "left");
  22. YAHOO.util.Dom.setStyle(window, "height", dragElTop);
  23. YAHOO.util.Dom.setStyle(window, "width", dragElLeft);
  24.  
  25. var y = parseInt(dragElTop) - 60;
  26. YAHOO.util.Dom.setStyle(body, "height", y + "px");
  27. }
  28. // END :: Event handlers
  29. }
  30.  
  31.