开发者

Using hover and click with jQuery UI tabs?

I am using the following code for my jQuery UI tabs:

$('#tabs').tabs({
    fx: { opacity: 'toggle', duration: 400 }}).tabs('rotate', 1000);
$("#tabs").hover(function() {
    $("#tabs").tabs("rotate",0);
},

function() {
    $("#tabs").tabs("rotate",1000);
});

$("#tabs").click(function() {
    $("#tabs").tabs('rotate', 0);
});

The tabs are rotating properly and the rotation stop when hovering with the mouse. However, the 'hover' function is also overriding the 'click' 开发者_高级运维function. How can I achieve a pause when hovering, and a complete stop to the rotation on click?


Try this

$('#tabs').tabs({ 
    fx: { opacity: 'toggle', duration: 400 }
}).tabs('rotate', 1000);

$("#tabs").hover(
    function() {
        $("#tabs").stop();
    },
    function() {
        $("#tabs").tabs("rotate",1000);
    }
);

$("#tabs").click(
    function() {
        $("#tabs").stop(true);
    }
);


just a week ago i looked for the same issue. Now i created an extesion: Pause on Hover for jQuery UI Tabs Rotate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜