I have successfully built a JQuery accordion using Soh Tanaka's Simple Accordion tutorial. I would like to be able to link to a specific accordion section from another page but I'm not sure how to do this. Any help would be greatly appreciated as I haven't had much luck finding any help specific to this tutorial. Thanks!
HTML:
<h2 class="acc_trigger"><a href="#">Web Design & Development</a></h2>
<div class="acc_container">
<div class="block">
<!--Content Goes Here-->
</div>
</div>
JQuery:
//Set default open/close settings
$('.acc_container').hide(); //Hide/close all containers
$('.acc_trigger:first').addClass('active').next().show(); //Add "active" class to first trigger, then show/open the immediate next container
//On Click
$('.acc_trigger').click(function(){
if( $(this).next().is(':hidden') ) { //If immediate next container is closed...
$('.acc_trigger').removeClass('active').next().slideUp(); //Remove all "active" state and slide up the immediate next container
$(this).toggleClass('active').next().slideDown(); //Add "active" state to clicked trigger and slide down the immediate next container
}
return false; //Prevent the browser jump to the link anchor
});