使用悬停并点击jQuery UI标签? [英] Using hover and click with jQuery UI tabs?

查看:124
本文介绍了使用悬停并点击jQuery UI标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的jQuery UI标签使用以下代码:

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?

推荐答案

尝试此操作

$('#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);
    }
);

这篇关于使用悬停并点击jQuery UI标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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