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" wrote:
> But also this is a jQuery UI callback,
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
> 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 r
Thanks for the replies Richard and Michael, that makes sense and now
works!
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?
cheers,
DAZ
On Dec 7, 10:55 pm, "Michael Ge
> From: DAZ
>
> Thanks Michael, the example you gave works great. I'm having
> some problems with a droppable though, here is the sample code:
>
> $("#dropper").droppable({
> accept: "#dragger",
> drop: function(ev, ui) {$(this).append("Dropped!");} });
>
> The function that is called on t
On Sun, Dec 7, 2008 at 3:22 PM, DAZ <[EMAIL PROTECTED]> wrote:
>
> The function that is called on the drop is likely to get very complex,
> so I'd like it in a separate function.
>
> However, my solution below doesn't work:
>
> $("#dropper").droppable({
> accept: "#dragger",
> drop: dropped()
>
Thanks Michael, the example you gave works great. I'm having some
problems with a droppable though, here is the sample code:
$("#dropper").droppable({
accept: "#dragger",
drop: function(ev, ui) {$(this).append("Dropped!");}
});
The function that is called on the drop is likely to get very co
Sure, you can do this, but it's less complicated than that.
Don't make your function a method of the jQuery object. Simply make it an
ordinary named function with *exactly* the same code as the anonymous
function.
So your code:
$("#test").click(function(){ $(this).css("color","pink") });
b
8 matches
Mail list logo