I have made this accordion to teach myself some jQuery with a help of a user from stack overflow: http://jsfiddle.net/LQsV5/
I was wondering how I could add the feature to change the tabs, so when the tab is closed, the background picture of the heading is grey and when the accordion is open, it stays like it is in the above example?
Thank you.
jsFiddle demo
CSS (Create a ".selected" class and set the desired background):
Than toggle this
.selectedclass with jQuery:Prest attention that inside the jQuery I used:
$('.acc li h3').next('.acc-section').hide();If you don’t want to see your slider appear opened by default before the whole page is loaded and that see it hide, remove that line and set in your CSS: