0

我有一个幻灯片,我有幻灯片上图像的链接。

当鼠标进入链接时,幻灯片会在鼠标离开时暂停并播放。

我的问题是,当您在链接上快速移动鼠标时,幻灯片似乎变得越来越快。

function begin_slideshow() {
     some code
}

和鼠标进入/离开功能

element.on('mouseenter', function () {
                var url = $(this).data('loc').replace('_t', '');//grabs the image
                fig.attr("src", url);//changes the source
                $('.shown').removeClass('shown');//the link that can be seen has a class of shown
                $(this).addClass('shown');//adds class of shown to the now showing link 
                clearTimeout(timer);
            }).on('mouseleave', function () {
                timer = setTimeout(begin_slideshow, 5000);
            });

我认为问题在于悬停在某个地方,希望您能提供帮助:)因为我真的被卡住了。

编辑

http://jsfiddle.net/uYMkr/8/

4

1 回答 1

0

我认为您的问题在于超时。然而,这似乎是正确的。因此,我认为问题存在于您对幻灯片代码的使用或幻灯片代码本身中。你能把那个贴出来吗?

于 2012-07-05T11:21:47.970 回答