将UL添加到jQuery UI选项卡

时间:2010-06-11 13:09:44

标签: jquery jquery-ui

似乎每当我尝试在使用jQuery UI - Tabs时在容器内添加UL时,它就会破坏javascript。有没有办法可以在这些容器中使用我缺少的UL?

由于

<div id="tabs">
        <div id="fragment-1">
            <h4>Pre-Press Requirements</h4>
            <span class="peesinal">&#149; SAMPLE of final artwork with noted sizes.</span><br /><br />
            <span class="peesinal">&#149; NATIVE FILES & High Resolution PDF preferred. Files must be created or saved to the listed accepted file formats.</span><br /><br />
            <span class="peesinal">&#149; FONTS used in files need to be supplied in a separate folder marked "fonts". Please ensure all families (screen & printer) fonts are supplied for the job.</span><br /><br />
            <span class="peesinal">&#149; IMAGES must be saved as CMYK and no less than 300dpi. NO RGB FILES! We  
                prefer images to be TIF or EPS formats. If you are submitting artwork for spot
                color printing vector artwork is preferred. Your images should be supplied in
                a separate folder marked "links". This will ensure proper reproduction of  
                your artwork.</span><br /><br />

                <span class="peesinal">&#149; COLORS need to be clearly specified. Pantone (PMS) colors preferred. Please
                specify if job is to be printed CMYK, spot color, etc.</span><br /><br />

                <span class="peesinal">&#149; BLEEDS should be no less than .25"</span><br /><br />

                <span class="peesinal">&#149; PDF's should be High Resolution. Please include any spot colors or CMYK format for full color printing. NO RGB FILES! All bleeds should be included with trim marks. All fonts must be embedded or outlined. No "layered" PDF files.</span>
                <a id="fileFormatsBlock" href="#fileFormats">
                    <div id="monitor"></div>
                    <span class="filelink">Acceptable File Formats</span>
                </a>
        </div>
        <div id="fragment-2">

            <div id="caption" class="ui-corner-all"><p>Our presses are all capable of sizes up to 11" x  17" using spot color or full color.</p></div>
        </div>
        <div id="fragment-3">
            <p>USA Quickprint has complete in house bindery to finish each job to meet your needs.</p>
            <ul>
                <li>1</li>
                <li>2</li>
                <li>3</li>
            </ul>
        </div>

        <div id="fragment-4">
            <p>We provide high speed digital black and white with in line punching, folding, and stapling. Or you can choose to upgrade to high speed digital full color with sizes up to 12" x 18".</p>
        </div>

        <ul>
            <li class="prepressTab ui-corner-all"><a href="#fragment-1"></a></li>
            <li class="pressroomTab ui-corner-all"><a href="#fragment-2"></a></li>
            <li class="binderyTab ui-corner-all"><a href="#fragment-3"></a></li>
            <li class="copyTab ui-corner-all"><a href="#fragment-4"></a></li>         
        </ul>
    </div>

3 个答案:

答案 0 :(得分:3)

您错过了#tabs div中的实际标签声明,如下所示:

<div id="tabs">
  <ul>
    <li><a href="#fragment-1">Tab 1 Title</a></li>
    <li><a href="#fragment-2">Tab 2 Title</a></li>
    <li><a href="#fragment-3">Tab 3 Title</a></li>
  </ul>  

You can see a demo with this fix here,唯一的其他更改是关闭#tabs div,可能只是一个未粘贴您的问题的结束</div>标记。

答案 1 :(得分:0)

开场#tabs div没有结束</div>。 此外,没有宣布标签链接。

<div id="tabs">
    <ul>
        <li><a href="#tabs-1">Nunc tincidunt</a></li>
        <li><a href="#tabs-2">Proin dolor</a></li>
        <li><a href="#tabs-3">Aenean lacinia</a></li>
    </ul>
    <div id="tabs-1">
        <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
    </div>
    <div id="tabs-2">
        <p>Morbi tincidunt, dui sit amet facilisis feugiat, odio metus gravida ante, ut pharetra massa metus id nunc. Duis scelerisque molestie turpis. Sed fringilla, massa eget luctus malesuada, metus eros molestie lectus, ut tempus eros massa ut dolor. Aenean aliquet fringilla sem. Suspendisse sed ligula in ligula suscipit aliquam. Praesent in eros vestibulum mi adipiscing adipiscing. Morbi facilisis. Curabitur ornare consequat nunc. Aenean vel metus. Ut posuere viverra nulla. Aliquam erat volutpat. Pellentesque convallis. Maecenas feugiat, tellus pellentesque pretium posuere, felis lorem euismod felis, eu ornare leo nisi vel felis. Mauris consectetur tortor et purus.</p>
    </div>
    <div id="tabs-3">
        <p>Mauris eleifend est et turpis. Duis id erat. Suspendisse potenti. Aliquam vulputate, pede vel vehicula accumsan, mi neque rutrum erat, eu congue orci lorem eget lorem. Vestibulum non ante. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce sodales. Quisque eu urna vel enim commodo pellentesque. Praesent eu risus hendrerit ligula tempus pretium. Curabitur lorem enim, pretium nec, feugiat nec, luctus a, lacus.</p>
        <p>Duis cursus. Maecenas ligula eros, blandit nec, pharetra at, semper at, magna. Nullam ac lacus. Nulla facilisi. Praesent viverra justo vitae neque. Praesent blandit adipiscing velit. Suspendisse potenti. Donec mattis, pede vel pharetra blandit, magna ligula faucibus eros, id euismod lacus dolor eget odio. Nam scelerisque. Donec non libero sed nulla mattis commodo. Ut sagittis. Donec nisi lectus, feugiat porttitor, tempor ac, tempor vitae, pede. Aenean vehicula velit eu tellus interdum rutrum. Maecenas commodo. Pellentesque nec elit. Fusce in lacus. Vivamus a libero vitae lectus hendrerit hendrerit.</p>
    </div>
</div>

Tab Demos

答案 2 :(得分:0)

最近我遇到了类似的问题。

在我发现在面板上方移动面板导航的UL修复了我的问题之后,我使用CSS来重新定位我的导航。

<!--Begin jquery ui tabs-->
    <section class="feature">
        <div class="nav-panel">
            <ul class="ui-tabs-nav container">                  
                <li class="ui-tabs-nav-item ui-tabs-selected" id="nav-panel-1"><a href="#panel-1">Dean's Message</a></li>
                <li class="ui-tabs-nav-item" id="nav-panel-2"><a href="#panel-2">M.D. Program</a></li>
                <li class="ui-tabs-nav-item" id="nav-panel-3"><a href="#panel-3">Joint M.D. Programs</a></li>
            </ul>               
        </div><!--end panel nav-->

        <div class="rotator">
            <div class="panel ui-tabs-panel" id="panel-1">
                <iframe title="YouTube video player" width="555" height="327" src="http://www.youtube.com/embed/Mp1uDB4Z3dI?rel=0&#38;autohide=1"></iframe>
                <h2><a href="/deans">Words of Welcome from the Dean</a></h2>
                    <p>A message from Dean Jones</p>
            </div><!--end panel 1-->

            <div class="panel ui-tabs-panel ui-tabs-hide" id="panel-2">
                <img src="/images/sized/images/content/adm-feature2-555x327-555x327.jpg" alt="Student practicing on a dummy" />
                <h2><a href="/programs/md-program">Excellence in Medical Education</a></h2>
                    <p>M.D. Program at the Miller School of Medicine</p>
            </div><!--end panel 2-->

            <div class="panel ui-tabs-panel ui-tabs-hide" id="panel-3">
                <img src="/images/sized/images/content/UceRf-XL--555x327.jpg" alt="Miller School of Medicine Students" />
                <h2><a href="/programs/md-program">Joint M.D. Programs</a></h2>
                    <ul>
                        <li>M.D./Ph.D.</li>
                        <li>M.D./M.B.A.</li>
                        <li>M.D./J.D.</li>
                    </ul>
            </div><!--end panel 3-->

        </div><!--end rotator-->
    </section><!--end feature section-->

CSS:

section.feature {
height: 350px;
position: relative;
}

section.feature div.nav-panel {
bottom: 0;
height: 24px;
position: absolute;
}