WordPress.org

Ready to get started?Download WordPress

Forums

Standard Widget Extensions
[resolved] Faster Accordion? (3 posts)

  1. Hidoshi
    Member
    Posted 8 months ago #

    Hey, this plugin is great so far, but I'm wondering if there is a way to make the accordion collapse/expand faster? It's a bit slow for what I'd like at the moment.

    Thanks!

    http://wordpress.org/plugins/standard-widget-extensions/

  2. blogger323
    Member
    Plugin Author

    Posted 8 months ago #

    Thank you for using the plugin.

    Though I'll consider if I could make it as a regular option, you can make the animation faster if you could modify a JavaScript file. Because it's not difficult, it's worth a try even if you are not a programmer.

    1. In the 'Standard WE' options page, set the 'Readable .js File' option to 'Enable'.
    2. In the 'Installed Plugins' page, click the 'Edit' link of Standard WE.
    3. Then choose standard-widget-extensions.js and modify it as follows (just adding three '200's).
    if (c) {
         if (c.is(":hidden")) {
           if (swe.single_expansion) {
    -        $(".hm-swe-accordion-head").not(this).next().slideUp();
    +        $(".hm-swe-accordion-head").not(this).next().slideUp(200);
             if (swe.heading_marker) {
               $(".hm-swe-accordion-head").not(this).css('background', swe.buttonplusurl + " no-repeat left center");
             }
           }
    
    -      c.slideDown(set_widget_status);
    +      c.slideDown(200, set_widget_status);
    
           if (swe.heading_marker) {
             $(this).css('background', swe.buttonminusurl + " no-repeat left center");
    }
         else {
    -      c.slideUp(set_widget_status);
    +      c.slideUp(200, set_widget_status);
           if (swe.heading_marker) {
             $(this).css('background', swe.buttonplusurl + " no-repeat left center");
           }

    Don't forget to save it. Now jQuery slideUp()/slideDown() functions are called with duration parameters. You can also set a value other than 200. Lower numbers are faster. Enjoy!

  3. blogger323
    Member
    Plugin Author

    Posted 7 months ago #

    I've made the 'Slide Duration' option in the version 1.2 to define the animation speed. And I'd like to mark this topic as resolved.

Reply

You must log in to post.

About this Plugin

About this Topic