开发者

JQuery : Can i have 2 tabs in the same page?

i'm trying to have 2 tabs in the same page, but the first works great, and the second doesn't work at all.

It is possible to have 2 tabs in the same page, if yes, how can i manage that?

Both have the same code ... example : $('#tab1').tabs(); and the other $('#tab2').tabs();

Thank you

My HTML:

<section>
<div id="radioprog">
    <h2 class="fire">R&aacute;dio</h2>
    <ul id="radio-nav">
        <li><a class="dia" href="#seg">2ª</a></li>
        <li><a class="dia" href="#ter">3ª</a></li>
    </ul>

    <div id="seg" class="programacao">
        seg
    </div>


    <div id="ter" class="programacao">
        ter
    </div>

</div>      
</section>

<section id="info-t开发者_开发问答ab" style="width:325px; margin-top:3px;">
<div id="tabs">
    <ul>
        <li><a href="#comentados">+ Comentados</a></li>
        <li><a href="#lidos">+ Lidos</a></li>
    </ul>

    <div id="comentados">
        <ul>
            <li><a href="#nowhere" title="Lorum ipsum dolor sit amet">Lorem</a></li>
            <li><a href="#nowhere" title="Aliquam tincidunt mauris eu risus">Aliquam</a></li>

        </ul>
    </div>

    <div id="lidos">

        <ul>
            <li><a href="#nowhere" title="Lorum ipsum dolor sit amet">Lorem</a></li>
            <li><a href="#nowhere" title="Aliquam tincidunt mauris eu risus">Aliquam</a></li>
        </ul>
    </div>
</div>      
</section>


You can have several tabs (nested, on the same level, etc).

You run into issues when they share the same IDs.

See:

http://jsbin.com/eqivo/edit


I really need to rest, it is working... the problem was that the text was the same and i didn't saw that.

Sorry.

Solved

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜