Reputation: 33
I wrote a script which load data compile it with handelbars to a string. Then I add these elements to the DOM and want to give them some eventlisteners and functions like draggable but it doesn’t work. It seems that it work asynchronously and not synchronously like I read here in many other posts. Can someone give me a hint where i think wrong?? I posted the code here
I would be really glad for any hint.
Upvotes: 1
Views: 46
Reputation: 8605
You look to have mis-typed your class name.
//
<div style="position:absolute; top:{{posy}}; left:{{posX}}" class="d_entity">
//
$(".p_entity").draggable().css("background","red");
Updated Example: http://jsfiddle.net/Zjx35/1/
Upvotes: 1