I have an accordion menu and I can't figure out how to link. The menu itself works fine.
When I click the below link, my first accordion menu should open up
<a href="case_studies.html#case1">Case study 1</a>
JavaScript for the accordion
<script type="text/javascript">
$(document).ready(function(){
$("a#show-panel").click(function(){
$("#lightbox, #lightbox-panel").fadeIn(300);
})
$("a#close-panel").click(function(){
$("#lightbox, #lightbox-panel").fadeOut(300);
})
})
</script>
<script type="text/javascript">
$(function(){
$("#accordion-header").accordion({ navigation: true });
});
</script>
The accordion.js file
$(document).ready(function()
{
//Add Inactive Class To All Accordion Headers
$('.accordion-header').toggleClass('inactive-header');
//Set The Accordion Content Width
var contentwidth = $('.accordion-header').width();
$('.accordion-content').css({'width' : contentwidth });
/* //Open The First Accordion Section When Page Loads
$('.accordion-header').first().toggleClass('active-header').toggleClass('inactive-header');
$('.accordion-content').first().slideDown().toggleClass('open-content'); */
// The Accordion Effect
$('.accordion-header').click(function () {
if($(this).is('.inactive-header')) {
$('.active-header').toggleClass('active-header').toggleClass('inactive-header').next().slideToggle().toggleClass('open-content');
$(this).toggleClass('active-header').toggleClass('inactive-header');
$(this).next().slideToggle().toggleClass('open-content');
}
else {
$(this).toggleClass('active-header').toggleClass('inactive-header');
$(this).next().slideToggle().toggleClass('open-content');
}
});
return false;
});
The Body code for the accordian is
<div id="accordion-container">
<p class="accordion-header" style="border-top:solid 1px #009edb; border-bottom:solid 1px #009edb;"><span style="padding-left:10px; color:#009edb; padding-top:10px; line-height:25px;"><a href="#case1">Case study 1</a></span></p>
<div class="accordion-content">
<div class="textInner">
TEST TEXT THAT FALLS UNDER THE MENU
</div>
</div>
<p class="accordion-header" style="border-top:solid 1px #009edb; border-bottom:solid 1px #009edb;"><span style="padding-left:10px; color:#009edb; padding-top:10px; line-height:25px;"><a href="#case2">Case study 2</a></span></p>
<div class="accordion-content">
<div class="textInner">
TEST TEXT THAT FALLS UNDER THE MENU
</div>
</div>
</div>
Any help is appreciated. I am running out of ideas here.
Cheers and thanks in advance, G