Droppable and sortable functions for dynamically created elements not working

Stuck in this problem for the last 2 days :-( Trying to create a draggable sortable list with dynamically added groups. Could create containers, but divs can not be dropped into these containers. Can someone tell me where I am doing it wrong, I know that it should be assigned to a variable, even tried it, still working now.The violin is as follows.

http://jsfiddle.net/Sullan/mLHJW/

+5
source share
3 answers

Just repeated the call inside the button, press ... not sure if it is correct ... but it works fine ...

http://jsfiddle.net/Sullan/mLHJW/1/

+5
source

, on jQuery 1.7. , 1.6, 1.5 -, live

$("p").on("click", function(){
alert( $(this).text() );
});

$("p").live("click", function(){
alert( $(this).text() );
});

insted

$("p").click( function(){
alert( $(this).text() );
});

on ad live

http://api.jquery.com/on/

http://api.jquery.com/live/

+5

try using this plugin http://docs.jquery.com/Plugins/livequery#Download

as soon as you enable it, just use it like this (example from your code):

var test = $('ul.itemsList').livequery(function(){
                    $(this).sortable({
                        connectWith: $('.itemsList, .itemsList li')
                    });
               });  
+2
source

All Articles