• I can set the accordion to start off closed. I can open an item OK, and then if I open another item the first item closes. This is fine.
    The problem comes when I try to close an item. It does close but then immediately opens itself. Is there anyway I can make it close properly?
    Thanks
    The site is on my WAMP so not accessible to others.

    https://wordpress.org/plugins/simnor-shortcodes/

Viewing 8 replies - 1 through 8 (of 8 total)
  • Same exact problem here. Did you ever find a solution?

    http://drummerboyhosting.com/solsa/solsa/

    Hi, is this supposed to be the actual functionality where the accordion menu won’t toggle closed?

    Thanks!

    Thread Starter PeterC66

    (@peterc66)

    Hi. I did not get an answer on the accordion, and could not myself see how to change the code to do it (with my limited coding skills).

    I changed to using a series of explicit Toggles, so each and every one can be open or closed. Even this is not ideal because some of my toggle contents are long and to close them users have to scroll up quite a bit. The facility to put buttons within the toggle text to close it would be nice.

    My site is now live and you can page using toggles at http://www.hcnhistory.org.uk/technical/. I am broadly very pleased with this plugin for toggles.

    Thanks to Simnor

    I was having this same issue and played around with the jquery a bit and got it to work by just commenting out a few lines in the includes/shortcodes.js
    The accordion section is at the very top, I commented out these 5 lines:

    /* Accordion */
    `// 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();
    //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);

    I’m a jquery novice so if this isn’t proper form, oh well – it worked for me! lol

    FGD

    (@creativetopia)

    Any luck with this?

    Is there any way to make the expanded div close when it is clicked?

    The information above is not really making sense. Surely there is a way to add some script into the header or footer of the website to allow for this functionality without editing the Plugin files.

    Thanks.

    /* Accordion */
    	jQuery('.simnor-shortcode-toggle-active').each(function() {
    		jQuery(this).find('.simnor-shortcode-toggle-content').show();
    	});
    	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();
    			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.toggleClass('simnor-shortcode-toggle-active');
    			toggle.find('.simnor-shortcode-toggle-content').slideToggle(500);
    		}
    	});

    Just comment out the one line shown above in the shortcodes.js file.

    FGD

    (@creativetopia)

    Thank you Captramrod01.

    That makes it close and not reopen but the minus icon still shows (that has to do with the css.) And, if this plugin gets updated, the client will have to repeat these steps.

    FGD

    (@creativetopia)

    Nevermind, I went with a different plugin since this one has no traction.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can't close the accordion’ is closed to new replies.