Draggable Start/Stop Parameter reference
I've looked for documentation on the details of the start and stop
parameters: e,ui; but have been unable to find anything, are these
documented anywhere?
I've made a draggable with a helper:clone at an opacity of 0.50
I'm using the start and stop callbacks to set the opacity of the
original draggable to 0.50 opacity as well. Thus you can visually tell
which object is being dragged.
If I reference the object directly (i.e. $('#myDraggable01')) then it
works perfectly, but I obviously don't want my function tied directly
to a single instance. I want to use the variables that are passed to
the call back.
My trial and error, I discovered that in the start callback
e.srcElement allows me to access the object I want. However in the
stop callback, e.srcElement and e.target both seem to reference the
cloned helper. My work around is to grab the reference from the start
callback and hold it in a global variable until the stop callback (but
this is bad style)
I'm new to jQueryUI, so I'm sure this is something simple I'm over
looking.
http://www.sfr-inc.com/dice/jQueryUI/ProofOfConcept2.html
What can I do to make the stop callback be in terms of the e or ui
variable instead of the global variable?
Note: On the 2nd example when I try stop: function(e,ui){$
(e.srcElement).removeClass('opacity_50')} my draggable (on my
browser) stayed at 0.50 and never went back to 'solid'
Cliff