Hi Richard, I’ve just found this post and have been playing around with adding further accordion items inside the original accordion, see example page: http://www.stundesign.co.uk/bickhambarn/new/test-two.html.
I’ve been adding the extra accordion items directly into your original .js file and re numbering as foolows:
$(document).ready(function() {
$('.accordionButton').click(function() {
$('.accordionButton').removeClass('on');
$('.accordionContent').slideUp('normal');
if($(this).next().is(':hidden') == true) {
$(this).addClass('on');
$(this).next().slideDown('normal');
}
});
$('.accordionContent').hide();
$('.accordionButton1').click(function() {
$('.accordionButton1').removeClass('on');
$('.accordionContent1').slideUp('normal');
if($(this).next().is(':hidden') == true) {
$(this).addClass('on');
$(this).next().slideDown('normal');
}
});
$('.accordionContent1').hide();
$('.accordionButton2').click(function() {
$('.accordionButton2').removeClass('on');
$('.accordionContent2').slideUp('normal');
if($(this).next().is(':hidden') == true) {
$(this).addClass('on');
$(this).next().slideDown('normal');
}
});
$('.accordionContent2').hide();
});
Is this the best way to be doing this? Also can I add some code that will make the ‘sub’ accordions slide shut rather than snap shut as they do now?
Thanks
Dave
freewaytalk mailing list
email@hidden
Update your subscriptions at: