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

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -