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:
- 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:...
- 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...
- 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...
- 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’,...
- 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: containment, div, google, ui
[...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]
[...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]
[...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]
[...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]
[...] Make New Div Draggable in Jquery | The Largest Forum Archive [...]