I think I see what you're doing - you're copying the demo program
which is
more for demonstrating various effects together instead of
demonstrating
proper syntax, but your code doesn't include the variables they used,
based
on what you posted.
Something like this would be your actual usage: (I don't have the
ui.effects
so I haven't tested this, but it should be ok)
$('#details_'+onderwerp).show("blind",{ direction: "horizontal" },
500,function(){
onOnderwerpChange(onderwerp);
});
function onOnderwerpChange(onderwerp) {
alert(onderwerp);
};
This page: http://docs.jquery.com/UI/Effects/Blind
has the basic show syntax without the callback.
{ direction: "horizontal" } is the type of thing that would be in the
option
variable in the demo.
And just a tip: If you aren't already, start using firebug and
console.log for
script development instead of relying on alert-it will make your life
easier.
On May 19, 8:29 am, rjonker <[email protected]> wrote:
> Hello all,
>
> I am trying to use a callback function on the show()
> effect.http://jqueryui.com/demos/show/
>
> For the callback argument it tells me this:
> "A function that is called after the effect is completed.".
> That's exactly what I want.
>
> But, I can't seem to figure it out.
>
> $('#details_'+onderwerp).show('blind', options, 500, onOnderwerpChange
> (onderwerp));
>
> function onOnderwerpChange(onderwerp) {
> alert(onderwerp)
>
> }
>
> The problem is that the alert() is executed before the effect is
> completed. The effect itself works fine.
> What do I do wrong?
>
> Thanks in advance for your replies.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---