1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| function add_fields(link, association, content) {
var new_id = new Date().getTime();
var regexp = new RegExp("new_" + association, "g");
$(link).parent().before(content.replace(regexp, new_id));
}
$(function() {
$( "#liste" ).accordion({autoHeight: false,});
$( "#liste li" ).draggable({
appendTo: "body",
helper: "clone"
});
$( ".text" ).droppable({
activeClass: "ui-state-default",
hoverClass: "ui-state-hover",
accept: "#liste li",
drop: function( event, ui ) {
$(this).insertAtCaret(ui.draggable.text());
}
});
}); |
Partager