Jquery Cycle in Drupal - onAfter effect not working.
- by jdln
Im using the views slideshow module for drupal which uses the jquery cycle plugin. 
Here is my first simple slideshow where everything works properly:
smartpeopletalkfast.co.uk/slideshow3/one
Here is my 2nd slideshow: 
smartpeopletalkfast.co.uk/slideshow3/two
Im trying to use the onAfter function. I want the next and previous buttons to be hidden when at the end of their cycle. This is demonstrated here: 
jquery.malsup.com/cycle/after.html
The first slideshow that's working has these controls:
prev: #prev1,
next: #next1
The 2nd slideshow has these: 
prev: #prev1,
next: #next1,
end: onAfterr, 
timeout: 0
And Ive added this to the beginning of my document head. 
<script type="text/javascript">
function onAfterr(curr, next, opts) {
    var index = opts.currSlide;
    $('#prev1')[index == 0 ? 'hide' : 'show']();
    $('#next1')[index == opts.slideCount - 1 ? 'hide' : 'show']();
}
</script>
I changed onAfter to onAfterr in case of a conflict. Nothing ive tried works and ive no idea why! Thanks