javascript - activeClass droppable's option equivalent to sortable [jQueryUI] -
in draggable-droppable combination:
while element being dragged if have specified option activeclass: "ui-state-hover", in droppable section available droppable elements change background-color , when element dropped in of these background-color returns initial.
how can accomplished using sortable? far know activeclass not exist in sortable. when start dragging-sorting element others of same class should change background color way show should me dropped..
any ideas??thanks in advance
after research came solution
using start , stop event of sortable solved task in hand
$("#reporttable").sortable({ items: 'tr', revert: true, helper: _$helpervalue, placeholder: "placeholder", containment:"#reporttable", start: function (event, ui) { cls = ui.helper.attr("class"); $('tr[class*="' + cls + '"]').addclass('placeholder'); }, stop: function (event, ui) { $('tr[class*="' + cls + '"]').removeclass('placeholder'); } }).disableselection(); after created class in css file change background-color each time start event fired store classname of element being crabbed , add class(placeholder) elements same class.
finally in stop event remove class , done!!!
Comments
Post a Comment