1 2 3 4 5 6 7 8 9 10 11 12 13
| var cadredrag = new Array(false,false,false,false,false,false,false,false,false,false,false,false);
// pour initialiser le retour à faux - j'utilise each pour avoir le numéro du cadre
$('.contenant-donnees').each(function(index, value){
$(this).draggable({stack: "div",revert: function(e,ui){
retour = cadredrag[index];
return retour;
}}).resizable();
});
// clic sur une croix : le cadre devrait revenir à sa position initiale
$('.cadre-croix').bind('click',function(){
var num = parseInt(this.id.substring(6,8));
cadredrag[num] = true;
}); |
Partager