Search code examples
jquerycycle

Variable issue with jQuery Cycle Plugin


Can some one assist me on this?

This is my JS

 /* Soccer Call */   
      var hoverIn = function() {
          $('#soccer').cycle({
              fx: 'scrollLeft', 
              speed: 1000,
              timeout: 100 
           });
        },
          hoverOut = function() {
          $('#soccer').cycle({
               fx:'pause'
            });
          };

        $('#soccer').hover(hoverIn, hoverOut); 

The error that i'm getting in my Console is

[cycle] unknown transition: pause ; slideshow terminating 

The jQuery Options are here


Solution

  • I figured out a solution to my problem.

        var $ss = $('#soccer').cycle({
            fx: 'scrollLeft',
            timeout: 2000
        }).hover(
    
        function() {
            // on hover over, advance the slide
            $ss.cycle('next').cycle('resume');
        }, function() {
            // on hover out, pause
            $ss.cycle('pause');
        }).cycle('pause');