jquery - Draggable - set helper if condition is true -
Is it possible to set assistant in jquery only (say) when you start dragging, the control key is pressed ? I tried to do this:
Start: function (Event, UI) {ui.helper =! Cntrl pressed? "Basic": $ (" ") Text ($ (this) .text ()). Css ({"background": $ (this) .Css ("background"), "padding": $ (this) .css ("padding"). Atter ("Data-Premet ID": $ (this) .attr ("data-permit id"), "data-print nazive": $ (this.) .attr ("data-predmetNaziv")} addClass (" Assistant"); } Thanks!
yes it is possible, accept options one function:
A function that will return a DOMElement to be used during dragging.
Here you can check whether CTRL is pressed and work accordingly to keep a jQuery / DOM element back in.
code:
$ (function () {$ ("# draggable"). Draggable ({Support: Work} (Evt) {Return! Evt.ctrlKey? $ (This): $ (" Demuoduo ");}}};}); Demo:
Comments
Post a Comment