jQuery UI Sortable is not working when using Masonry. Any idea how to avoid this conflict? Any help would be appreciated.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
I think i had a similar problem.
I managed to fix it by simply recalling masonry within the code for setting up the sortable elements. (there might be a better way, i'm not sure?)
$(function() { $("#youritem").sortable({ opacity: 0.9, cursor: 'move', update: function() { var order = $(this).sortable("serialize") + '&action=updateRecordsListings'; $.post("dosomething.php", order, function(theResponse){ //you can see that i've re-called masonry once the sortable object has been moved $('#youritem').masonry({columnWidth: 200, itemSelector: 'youritem' }); }); } }); });
回答2:
I also had similar problem, but then i found a working Masonry&Sortable&resizable example:
http://tyler-designs.com/masonry-ui/
Not perfect, but it's a good starting point.
回答3:
Use gridster ― it works like a charm and very intuitive