/ Published in: jQuery
                    
                                        
Con esta lÃneas de programación, puedes crear listas Drag & Drop utilizando jQuery UI; permitiendo al usuario reorganizar los "items" seleccionados.
El funcionamiento interno, permite el envÃo usando un formulario ya sea por GET o POST.
                El funcionamiento interno, permite el envÃo usando un formulario ya sea por GET o POST.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
//Arrastrar items
$('.supermercado div,.lista div').draggable({
cursor: 'pointer',
connectWith: '.lista',
helper: 'original',
opacity: 0.5,
zIndex: 99,
revert: true
});
//Reordenamiento de los items
$('.lista,.supermercado').sortable({
connectWith: '.lista,.supermercado',
cursor: 'pointer'
}).droppable({
accept: '.supermercado div',
activeClass: 'highlight',
drop: function(event, ui) {
var $li = $('<div value="' + ui.draggable.attr("value") + '">').html(ui.draggable.html());
$li.appendTo(this);
ui.draggable.hide();
valores();
}
});
function valores() {
var valores = "";
$('.lista div').each(function() {
valores += $(this).attr("value") + ",";
});
$("#productos").val(valores.substr(0,(valores.length-1)));
}
Comments
 Subscribe to comments
                    Subscribe to comments
                
                