<$(function() { $(".coursetr").draggable({ helper: "clone", revert: "invalid", refreshPositions: true }); $(".coursetr").droppable({ accept: ".coursetr", //placeholder: ".HeaderHomeActive", activeClass: "ui-state-hover", hoverClass: "ui-state-active", drop: function(event, ui) { var draggable = ui.draggable, droppable = $(this), dragPos = draggable.position(), dropPos = droppable.position(); draggable.css({ left: dropPos.left + 'px', top: dropPos.top + 'px' }); droppable.css({ left: dragPos.left + 'px', top: dragPos.top + 'px' }); var t1 = $(droppable).data('courseid'); var t2 = $(draggable).data('courseid'); draggable.swap(droppable); } }); });
var t1 = $(droppable).data('id'); var t2 = $(draggable).data('id'); if (t1 =t2) { draggable.swap(droppable)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)