> Currently, I have implemented a small image gallery using the jQuery
> Cycle plugin. It's working perfectly but I would also like to add
> callbacks. How do I successfully do this? I currently have:
>
> jQuery(document).ready(function(){
>         jQuery('#frame1').cycle({
>         fx:'fade',
>         speed:'500',
>         timeout: 0,
>         next:'#next2',
>         prev:'#prev2',
>         });
>         });

Watch out for that last comma (after '#prev2', that's a script killer
in IE).


> What I would like to happen is as a user scrolls to the next image
> (which fades in) the image and its corresponding caption appears
> (basic styled text below it). The same action also when a user clicks
> previous for the last image.

The 'before' and 'after' callbacks will help you here.  Check out this
demo:

http://www.malsup.com/jquery/cycle/after.html



> Also, I have general concerns about script loading. I have quite of
> number of linked js files in my header. Seemingly, when you select and
> view a webpage for the first time, the above script doesn't work -
> only when you hit refresh does the image gallery appear properly. Is
> this a problem at all?

Hard to say without seeing it in action.  Can you post a link?

Reply via email to