I have been following tutorials from "learnnerd", a Youtube contributer. Url here I have made my website using the codes he provided. Here's my website. (check services)
I would like to link a tab on my home page to open a specific accordion in my services pages. I've researched but still know little. I don't know much about Javascript. My php/html code looks like:
<h2 class="accordion"><a href="#1"> Antenna</a></h2>
<h2 class="accordion"><a href="#2"> Digital</a></h2>
My script (from "learnnerd (Youtube)" and Atomix(here)) looks like this:
$(function(){
$('.accContainer').hide(); //hide all content
$('.accordion').click(function(){
if( $(this).next().is(':hidden') ) {
$('.accordion').next().slideUp();
//triggers the hiding of contents
$(this).next().slideDown();
//triggers slide down of contents
}
return false; //prevents brower default
});
$(".accordion").accordion({
header: "h2", navigation: true
});
}); //document.ready function
Thank you.