How to make dynamic data draggable after loading from server
Hello,
I'm rather a beginner using jQuery. It's fun but I need some help ...
I'm not sure how to make something draggable which is dynamically loaded. The click event works fine on the new content though.
Like for example:
- $('.file').live('click', function() {
- alert('clicked');
- });
-
- // Load new content after click
- $('.icon').live('click', function() {
- var fileId = $(this).attr('id');
- $.post("/get_content/", {'file_id' : fileId},
- function(data) {
- $.each(data, function(i,data){
- $("#fileDialog").append(<div class="file">data</div>);
- );
- }, "json");
-
- $('.file').draggable();
- });
This doesn't work :-( The click event does work on the new content, but the new files aren't draggable.
Can somebody help me out plz ...
Thx! :-)
Christophe