Javascript滚动菜单 - MouseOver选择在第一次联系时无法正常工作 [英] Javascript Scroll Menu - MouseOver Selection not working correctly on first contact

查看:84
本文介绍了Javascript滚动菜单 - MouseOver选择在第一次联系时无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用一个自动循环的标签菜单。一旦我鼠标悬停在其中一个标签上,旋转应停在选定的标签上,当我鼠标输出时,它应继续从所选标签项旋转。

I am currently working with a tab menu which cycles through automatically. Once I mouseover one of the tabs the "rotation" should stop on the selected tab and when I mouseout it should continue rotating from the selected tab item.

$(document).ready(function() {

$("#featured > ul").tabs({ fx: { opacity: "toggle"} }).tabs("rotate", 1000, true);

$("#featured > ul").mouseover(function() {
    $(this).tabs({ event: 'mouseover', fx: { opacity: "toggle"} }).tabs("rotate", 0);
})

$("#featured > ul").mouseout(function() {
    $(this).tabs("rotate", 1000);
})
});

当MouseOver循环停止但没有选择正确的项目时,一旦我mouseOut然后MouseOver再次功能完美!
我的问题在于第一个mouseOver代码似乎没有正确加载?

At the moment the when MouseOver the cycle stops but does not select the correct item, once I mouseOut then MouseOver again the functionality works perfectly! My issue lies where on first mouseOver the code doesnt seem to be loading correctly?

任何想法?非常感谢帮助。

Any ideas? Help will be really appreciated.

再次感谢您的时间..

Thanks again for your time..

推荐答案

试试这个:

$("#featured > ul").mouseover(function() {
    $(this).tabs("abort");
    $(this).tabs({ event: 'mouseover', fx: { opacity: "toggle"} }).tabs("rotate", 0);
    $(this).tabs("select", this.id); 
});

这篇关于Javascript滚动菜单 - MouseOver选择在第一次联系时无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆