0

I'm trying to sync a plugin called Supersized:

http://buildinternet.com/project/supersized

with the jQuery Cycle plugin.

I've got everything working well by using a function to stop both the slides and then run them together in unison. The only place where I'm hitting a wall is with the nav buttons/keyboard presses.

The issue I'm having is that I need to be able to check if the supersized is already animating otherwise only the jquery cycle is triggered, putting my two images out of sync.

Supersized comes with a variable you can check to see if it's in animation. Only problem is, if you press the button or keypress it has already triggered the animation state by the time the on page script can check it.

Any ideas?

4

1 回答 1

0

好吧,我想出了一个方法来做到这一点,所以我想我应该分享一下。

由于幻灯片是按索引匹配的,我只需要使 jQuery Cycle 当前幻灯片匹配当前由超大显示的幻灯片索引,使用此功能:

window.matchSlides = function()
{
    $j('#subBanner').cycle(vars.current_slide, 'fade');
}

然后在我的主题文件中由 beforeAnimation 调用该函数(检查该函数是否存在 - 因为我在站点的其他部分使用此插件也没有此要求:

if(typeof window.matchSlides == 'function') {
    window.matchSlides();
}
于 2013-05-07T01:05:52.553 回答