Make New Div Draggable in Jquery

Tags: , , ,
Posted in dotnet, vb, vb.net | 5 Comments »

I am trying to make jquery add new div and then make it draggable but i have been trying and looking on google and i can’t find anything here is my code below

 $(document).ready(function() {

 $("#draggable").draggable({
   containment: 'parent',
   handle: 'drag_border',
   drag: function(e, ui) {
          var top = ui.position.top;
          var left = ui.position.left;
          $("#top").html(top);
          $("#left").html(left);
           }
       });
   });

       function New_Text() {
            $("<div id="draggable" style="width: 200px; height: 50px; border:dashed thin; background-color: #fff">Drag me</div>").appendTo("div#drag_border");
              }

Thank you

Similar:

  1. How to stop Div Moving out of the border Jquery draggable(); How to stop the div from moving out of the border div Here is the code i got so far. <script> $(document).ready(function() { $("#draggable").draggable({ grid:...
  2. overlaying a jquery draggable div I’m trying to make an optional draggable div, which shows up at some condition. This does work for me. The Initial location is fine, but...
  3. Jquery Draggable UI overrides normal browser behavior for HTML elements inside draggable-enabled div I have a jquery ui draggable div, and the HTML contents do not behave normally because of the draggable. <div id="popup"> <!-- this popup is...
  4. JQuery draggable within an overflow: auto div is confined within the div. I have a draggable UL with a set height/width. This draggable list can be dragged to a sortable list. My code: $(“.serviceMembersAvailable li”).draggable({ helper: ‘clone’,...
  5. Draggable Clones Jquery? Any ideas on how to make the clones draggable? $("#draggable").draggable({ helper: 'clone', cursor: 'pointer', }); $("#snaptarget").droppable({ drop: function(event, ui) { var randomnumber = Math.floor(Math.random()*1000000); var...

Tags: , , ,

5 Responses to “Make New Div Draggable in Jquery”

  1. [...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]

  2. [...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]

Leave a Reply