ScareCrowe
06-29-2007, 06:01 PM
So, I am starting to play around with the Scriptalicious (http://script.aculo.us/) and Prototype (http://www.prototypejs.org/) libs.
( If you haven't already, you're missing out! )
Anywho, I am able to get them to work fine independently, but I have to call each one seperately. This works, but does not give me the desired effect.
Basically right now I assign the onClick event with 2 sep calls like so:
onClick="new ajax.updater('divID','scriptURL');new effect.hightlight('divID');"
I've been playing around with the before and after 'callbacks' for each script, but still can't get it right.
Basically, What I want to happen is:
onClick: do an effect, send ajax request, do another effect.
So, what user will see when they click will be let's say, the div fades out, then ajax is called filling now hidden div with new content, then the hidden div slides down into view.
I'd like to just use one method call in the onClick event like so:
onClick="new ajax.updater('divID',{onCreate:effect.fade('divID'),onComplete:effect.BlindDown('divID')});"
What I am getting now is the ajax is called first, it populates new info in div, then the effects are triggered! So user sees new info pop in then it fades out then slides back in, lol!
Anywho, I hope someone can help point me in the right direction!
Thanks in advance!
ps. the code snippets here are just examples so you can get the gist of what I'm doing, I know they aren't syntatically correct ;)
( If you haven't already, you're missing out! )
Anywho, I am able to get them to work fine independently, but I have to call each one seperately. This works, but does not give me the desired effect.
Basically right now I assign the onClick event with 2 sep calls like so:
onClick="new ajax.updater('divID','scriptURL');new effect.hightlight('divID');"
I've been playing around with the before and after 'callbacks' for each script, but still can't get it right.
Basically, What I want to happen is:
onClick: do an effect, send ajax request, do another effect.
So, what user will see when they click will be let's say, the div fades out, then ajax is called filling now hidden div with new content, then the hidden div slides down into view.
I'd like to just use one method call in the onClick event like so:
onClick="new ajax.updater('divID',{onCreate:effect.fade('divID'),onComplete:effect.BlindDown('divID')});"
What I am getting now is the ajax is called first, it populates new info in div, then the effects are triggered! So user sees new info pop in then it fades out then slides back in, lol!
Anywho, I hope someone can help point me in the right direction!
Thanks in advance!
ps. the code snippets here are just examples so you can get the gist of what I'm doing, I know they aren't syntatically correct ;)