Create element automatically register event handlers to be draggable
Say I have some code like this which is called on $(document).ready():
$(".banana").draggable();
$("body").on("click", "button", function(e){
$(".banana:first").clone().text('new text').;
});
and:
<div class="container">
<button>add</button>
<div class="banana">banana 1</div>
</div>
So,the problem is when I click to create copies of div.banana. It don't
automatically register event handler for draggable. I try something but
I'm sure that's not a good way: jsfiddle. Dont know trouble with jsfiddle.
Then I use jquery 1.9 + jQuery UI 1.9.2
No comments:
Post a Comment