Jquery Cycle in Drupal - onAfter effect not working.

Posted by jdln on Stack Overflow See other posts from Stack Overflow or by jdln
Published on 2010-12-29T13:51:22Z Indexed on 2010/12/29 13:53 UTC
Read the original article Hit count: 279

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

© Stack Overflow or respective owner

Related posts about drupal

Related posts about jquery-plugins