Can't close accordian – solution
-
Hi all,
Further to the issue around closing the accordion, I’ve adjusted the jQuery on my own site by adding the following adjusted JavaScript to my child theme’s global js file.
It unbinds the click function loaded by the plugin, before binding the new adjusted function which allows the accordion to close on a second click.
Works with plugin v1.8.
Hope it helps someone!
G
jQuery(document).ready(function(){ jQuery('.simnor-shortcode-toggle .simnor-shortcode-toggle-heading').unbind('click'); jQuery('.simnor-shortcode-toggle .simnor-shortcode-toggle-heading').click(function() { var toggle = jQuery(this).parent('.simnor-shortcode-toggle'); if(jQuery(this).parent('.simnor-shortcode-toggle').parent('div').hasClass('simnor-shortcode-accordion')) { toggle.parent('div').find('.simnor-shortcode-toggle').find('.simnor-shortcode-toggle-content:visible').slideUp(); if(!jQuery(this).parent('div').hasClass('simnor-shortcode-toggle-active')){ toggle.parent('div').find('.simnor-shortcode-toggle-active').removeClass('simnor-shortcode-toggle-active'); toggle.toggleClass('simnor-shortcode-toggle-active'); toggle.find('.simnor-shortcode-toggle-content').slideToggle(500); } else { toggle.parent('div').find('.simnor-shortcode-toggle-active').removeClass('simnor-shortcode-toggle-active'); } } else { toggle.toggleClass('simnor-shortcode-toggle-active'); toggle.find('.simnor-shortcode-toggle-content').slideToggle(500); } }); });
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Can't close accordian – solution’ is closed to new replies.