Cycle "end:" option - implementation confusion
Hello,
I'm using Cycle to display a non-wrapping intro slideshow with which I would like to use the "end:" option to fire a callback function. The cycle website's option reference says that the "end:" value is a "callback invoked when the slideshow terminates (use with autostop or nowrap options): function(options) ."
The desired result is for the slideshow to terminate, then fire a function that takes the browser to a new page. Sounds simple enough, and the "end:" sounds like just the ticket...
However when I try to implement it, the callback doesn't fire when the slideshow terminates; it fires at the beginning of what would be the first transition. Am I misunderstanding how this option is supposed to work?
If I remove the end: option from the script, the slideshow runs as intended, once through, and stops at the last slide. So I know I've got that part right.... but can't understand why when I ask it to fire a function at the "end" it doesn't do so at the end - more like the beginning?!
<script type="text/javascript">
function goToHomePage(){location="home.php";}
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#intro_slideshow img:first').fadeIn(2000, function(){
$('#intro_slideshow').cycle({
timeout: 3200,
speed: 1000,
nowrap: true,
end: goToHomePage()
});
});
});
</script>