0

有人可以帮助我吗?

这是我的 JS

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

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

我在控制台中遇到的错误是

[cycle] unknown transition: pause ; slideshow terminating 

jQuery 选项在这里

4

2 回答 2

1

看起来暂停不是 fx 支持的值。基于此,我不完全确定,但我相信你想要:

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

 $('#soccer').hover(hoverIn, hoverOut);
于 2012-10-29T16:53:55.543 回答
0

我想出了一个解决我的问题的方法。

    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');
于 2012-10-31T15:41:56.223 回答