javascript - Using Accordions and Tabs -
this question has been asked before not solved.
i'm using jquery tabs , accordion, both on same page , simple won't work together. work seperate on individual pages, theyre on same page tabs won't work. in fact, flips randomly between 1 works , 1 doesnt when reload page. i'm hoping nest accordions within tabs using jquery.
reordering js loading order doesnt appear people have had luck doing, though instinct loading order issue.
here html:
<div id="styleguide-tabs-demo-regular"> <ul> <li><a href="#tabs-1">tab one</a></li> <li><a href="#tabs-2">tab two</a></li> <li><a href="#tabs-3">tab three</a></li> </ul> <div id="tabs-1">tab 1 content</div> <div id="tabs-2">tab 2 content</div> <div id="tabs-3">tab 3 content</div> </div> <p><br /><br /><br /><br /></p> <div class="styleguide_demo_accordion1"> <h3><a href="#">section 1</a></h3> <div> <div class="styleguide-section__accordion-demo-element">content section 1</div> </div> <h3><a href="#">section 2</a></h3> <div> <div class="styleguide-section__accordion-demo-element">content section 2</div> </div> <h3><a href="#">section 3</a></h3> <div> <div class="styleguide-section__accordion-demo-element">content section 3</div> </div> </div> <p> </p>
jquery:
$("div.styleguide_demo_accordion1").accordion({header: "h2", collapsible: true, heightstyle: "content", active: false}) $("div#customaccordion").accordion({header: "h2", collapsible: true, heightstyle: "content", active: false}) $(function() { $( "#tabs" ).tabs(); }); $("div#styleguide-tabs-demo-regular").tabs();
any amazing!
i tried code, created jsfiddle , had change line:
$("div.styleguide_demo_accordion1").accordion({header: "h2", collapsible: true, heightstyle: "content", active: false})
to
$("div.styleguide_demo_accordion1").accordion({header: "h3", collapsible: true, heightstyle: "content", active: false})
so basically, after changing header
option h2
h3
, appears work intended. possible made typing error?
Comments
Post a Comment