Guest User

Untitled

a guest
Jun 20th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. //this makes elements with the draggable class draggable
  2. <script>
  3. $( function() {
  4. $( ".draggable" ).draggable();
  5. } );
  6. //this inserts a draggable div on page load, will conert this to a button
  7. //call function later once i get inserting draggable divs working
  8. $(document).ready(function(){
  9. $('#Container').append($("<div class='draggable'> This should be draggable</div>"));
  10. });
  11. </script>
  12. </head>
  13. <body>
  14. <!-- Putting divs inside this Container --->
  15. <div id="Container" style="border:solid; width:500px; height:500px;">
  16. </div>
  17.  
  18. $(document).ready(function(){
  19. $('#Container').append($("<div class='draggable'> This should be draggable</div>"));
  20. $(".draggable").draggable();
  21. });
Add Comment
Please, Sign In to add comment