WordPress.org

Forums

Simnor Shortcodes
Can't close the accordion (9 posts)

  1. PeterC66
    Member
    Posted 1 year ago #

    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/

  2. atlanteavila
    Member
    Posted 1 year ago #

    Same exact problem here. Did you ever find a solution?

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

  3. atlanteavila
    Member
    Posted 1 year ago #

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

    Thanks!

  4. PeterC66
    Member
    Posted 11 months ago #

    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

  5. plutz1133
    Member
    Posted 9 months ago #

    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

  6. FGD
    Member
    Posted 3 months ago #

    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.

  7. Captramrod01
    Member
    Posted 3 months ago #

    /* 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.

  8. FGD
    Member
    Posted 3 months ago #

    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.

  9. FGD
    Member
    Posted 3 months ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Simnor Shortcodes
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic