Just to say a belated thanks to both of you for this help - it is very
useful and helped me lots in learning how to use jQuery. I still have
lots left to learn, but I'm finding it a great library.

cheers,

DAZ

On Dec 8, 8:35 pm, "Richard D. Worth" <rdwo...@gmail.com> wrote:
> But also this is a jQuery UI callback, which means jQuery UI is already
> passing two parameters to this function, event, and ui. See
>
> http://docs.jquery.com/UI/Droppable/droppable#options
>
> "All jQuery UI callbacks receive two arguments: The original browser event
> and a prepared ui object, view below for a documentation of this object (if
> you name your second argument 'ui'):
>  * ui.options - options used to initialize the droppable
>  * ui.position - current position of the draggable helper
>  * ui.absolutePosition - current absolute position of the draggable helper
>  * ui.draggable - current draggable element
>  * ui.helper - current draggable helper"
>
> So if you're interested in those, you can do
>
> drop: function(event, ui) {
>   dropped(foo, bar, event, ui)
> //or
>   dropped(event, ui, foo, bar)
>
> })
>
> or something like that.
>
> If the arguments that the plugin provides are sufficient (you don't need to
> pass any of your own arguments), your setup might look something like this
>
> function dropped(event, ui) {
>  ...
>
> }
>
> $("#myDiv").droppable({
>   ...,
>   drop: dropped
>
> }
>
> So you still just provide a reference to the function, regardless of how
> many parameters it will be passed/what they are named.
>
> - Richard
>
> On Mon, Dec 8, 2008 at 3:15 PM, Michael Geary <m...@mg.to> wrote:
>
> > > From: DAZ
>
> > > Just one more question - what if I need to provide arguments
> > > to the function? Don't these need to go in parens which will
> > > then cause the function to be called immediately?
>
> > Then you wrap the function call in another function (typically an anonymous
> > function, but could be a reference to a named function):
>
> >    drop: function() { dropped(foo,bar); }
>
> > -Mike

Reply via email to