簡體   English   中英

jQuery UI標簽在頂部和底部

[英]jquery ui tab at both top and bottom

我想要一個具有頂部和按鈕菜單功能的Jquery UI選項卡,可以這樣做嗎? (通過ajax加載內容,這是同時顯示頂部標簽和底部標簽的意思。)

<script type="text/javascript" charset="utf-8">
    $(function() {
        $( "#tabs" ).tabs({                 
            ajaxOptions: {
                error: function( xhr, status, index, anchor ) {
                    $( anchor.hash ).html(
                        "Couldn't load this tab. We'll try to fix this as soon as possible. " +
                        "If this wouldn't be a demo." );
                }
            },
            cookie: {
                // store cookie for a day, without, it would be a session cookie
                expires: 1
            }
        });
});
</script>
<div id="tabs"> 
    <ul id="top"> 
       <li><a href="top1.php">top 1</a></li> 
       <li><a href="top2.php">top 2</a></li> 
    </ul> 
    <ul id="bottom"> 
       <li><a href="bottom.php">bottom 1</a></li> 
       <li><a href="bottom.php">bottom 2</a></li> 
    </ul> 
</div>

先感謝您!

對於要實現的目標,我有點困惑,但是如果您要像在jQuery UI選項卡中一樣進行類似的布局-如何更改選項卡位置 ,那么如果您不介意使用固定高度的選項卡布局,那么您可以像我在這里一樣簡單地通過CSS移動標簽頁http://jsfiddle.net/L6QjK/2/

如果您一定要注意固定的高度,那么到目前為止,我唯一的想法是使用一個控制面板創建布局,而不是添加一些<div>作為控制面板,並在代碼初始化后通過使用以下方法移動一些選項卡:

$("#yourFakeControlPanel").append($(".ui-tabs-nav").find("#yourTab"));

$(".ui-tabs-nav").find("#yourTab").remove();

當所有選項卡都是靜態的時,這是可行的,但是在動態添加新選項卡時遇到了一些錯誤,因此請將此作為提示,而不是確切的答案

我想我終於找到了你的答案。 看我的帖子,我在那里寫了如何在頂部和底部同時創建jQuery UI選項卡-如何更改選項卡位置

如果zou覺得有幫助,請將其標記為引導他人尋求正確解決方案的答案

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM