jQuery UI选项卡在加载时不隐藏不活动的选项卡 [英] jQuery UI Tabs not hiding inactive tabs on load

查看:78
本文介绍了jQuery UI选项卡在加载时不隐藏不活动的选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用jQuery标签时遇到了一个奇怪的问题.这些选项卡可以正常工作,但是处于活动状态的面板在加载时仍然可见,并且只有在选择其他选项卡时它们才会被隐藏.

I'm having a strange problem with jQuery tabs. The tabs are working fine, but the inactive panels are remaining visible on load, and it's only when selecting other tabs that they are hidden.

这是我的代码:

<head>
<link rel="stylesheet" href="css/jquery.ui.all.css" type="text/css" media="screen" />
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.custom.min.js"></script>
<script type="text/javascript">
jQuery.noConflict(); 
(function($) {
    $(function() {  
        /* UI Tabs */
        $.fn.tabs && $(".tabs").tabs();
    });
}) (jQuery);
</script>
</head>
<body>
<div class="tabs">
    <ul>
        <li><a href="#tab-1">Tab 1</a></li>
        <li><a href="#tab-2">Tab 2</a></li>
        <li><a href="#tab-3">Tab 3</a></li>
    </ul>
    <div id="tab-1">
    ...
    </div>
    <div id="tab-2">
    ...
    </div>
    <div id="tab-3">
    ...
    </div>
</div>
</body>

我以前没看过.有人可以发现我可能错过的任何东西吗?

I've not seen this before. Can anyone spot anything I might have missed?

干杯, RJ

推荐答案

有点粗略,因为它不能解决问题的根源,但可以解决.我只是将以下内容添加到样式表中.

Bit crude as it doesn't address the root of the problem but it sure solved it; i simply added the following to my stylesheet.

    <style>
        .ui-tabs-hide { display: none; }
    </style>`

希望它对某人有帮助.

这篇关于jQuery UI选项卡在加载时不隐藏不活动的选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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