Posted By

brianyang on 09/01/09


Tagged

div draggable jQueryUI


Versions (?)

jQueryUI draggable div


 / Published in: jQuery
 

URL: http://code.google.com/apis/ajax/playground/?exp=libraries#jqueryui

load jQueryUI and then make a draggable div

  1. /*
  2. * How to load jQueryUI and then make a draggable div with it.
  3. */
  4.  
  5. google.load("jquery", "1");
  6. google.load("jqueryui", "1");
  7.  
  8. function OnLoad(){
  9. $('#content').html('<div id="draggable-handle-div" style="width:100px;border:1px solid #999;">' +
  10. '<div style="background-color:#999">dragme</div>content</div>');
  11. $("#draggable-handle-div").draggable({
  12. "handle": "div"
  13. });
  14. }
  15.  
  16. google.setOnLoadCallback(OnLoad);

Report this snippet  

You need to login to post a comment.