Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change animation speed of Jquery UI Accordion

I'm using the Jquery UI Accordion, and I haven't found anywhere in the documentation on how to change the speed of the animation. I've found people suggest using option "animated: 'bounceslide'" but haven't been able to find what the different available options are for animated.

My current js is as follows

    $( "#accordion" ).accordion({
        event: "mouseover",
        animate:"slow",
        active:false
    });

The "animate:"slow" is not correct and therefore not working. Any ideas?

like image 900
ToraRTC Avatar asked Sep 26 '11 18:09

ToraRTC


2 Answers

This works fine for me :

$("#accordion").accordion({
    animate: {
        duration: 500
    }
});
like image 200
Mehdiway Avatar answered Oct 08 '22 01:10

Mehdiway


This is currently not directly possible, although a feature request has been logged and is scheduled to implemented by the 1.9 milestone: http://bugs.jqueryui.com/ticket/3772. You can either wait for that release, or try the subclassing method described here: http://bugs.jqueryui.com/ticket/3533.

This boils down to:

$.extend($.ui.accordion.animations, {
  fastslide: function(options) {
    $.ui.accordion.animations.slide(options, { duration: 100 }); }
  });
like image 27
pgl Avatar answered Oct 08 '22 02:10

pgl