accordion tab open at different times

Posted by user3279193 on Stack Overflow See other posts from Stack Overflow or by user3279193
Published on 2014-06-10T15:02:07Z Indexed on 2014/06/10 15:24 UTC
Read the original article Hit count: 179

I am using an asp classic and on the page I have a J-Query accordion. I want one tab to be open if the value that the asp prints out is greater than zero, if not , I want them all to be closed, this is an example of what I've got:

J-Query:

$(function() {
    $( "#accordion" ).accordion({
        heightStyle: "content",
        collapsible: true,
        active: false
    });
});

HTML/ASP:

<div id="accordion">
    <h3>Tab1</h3>
    <div>
        <p>Hello World</p>
    </div>
    <h3>Tab2</h3>
    <div>
        <p>Hello World</p>
    </div>
    <h3>Tab3</h3>
    <div>
        <p>Hello World</p>
    </div>
    <h3>Results (<%=number%>)</h3> <!--if number > 0 then open tab else close all tabs-->
    <div>
        <p>Hello World</p>
    </div>
</div>

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html