/* * JavaScript used on ScratchFramework shortcodes. * Box shortcode Close button * Tabs shortcode * Toggle shortcode */ jQuery(function($) { /* Box Close Button */ jQuery(".of-sc-box").each(function(){ $(this).append(''); $(this).find('.hide_box').click(function(){ $(this).parent().hide(); }); }); /* Standard Toggles and FAQs */ jQuery(".toggle").each( function () { if(jQuery(this).attr('data-id') == 'closed') { jQuery(this).accordion({ header: 'h5', collapsible: true, active: false }); } else { jQuery(this).accordion({ header: 'h5', collapsible: true}); } }); jQuery(".faq").each( function () { if(jQuery(this).attr('data-id') == 'closed') { jQuery(this).accordion({ header: 'h5', collapsible: true, active: false }); } else { jQuery(this).accordion({ header: 'h5', collapsible: true}); } }); });