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