views:

42

answers:

1

Everything works just fine, but when I remove

{queue:false, duration: 800, easing: 'easeInOutQuart'} 

from

$(".chapters_list").slideDown(

with a 500, it stops working. So if I don't want easing in my script, it will work fine, when I insert easing into the top function, like is shown below, it stops working. Why wont it allow me to have easing?

$('.article_book_title').click(function () {
    if ($(".chapters_list").is(":hidden")) {
        $(".chapters_list").slideDown({queue:false, duration: 800, easing: 'easeInOutQuart'}, function () {
        doSlide($('UL.chapters_list li:first'))
        });   
} else {
$(".chapters_list").slideUp({queue:false, duration: 800, easing: 'easeInOutQuart'});
}
});


function doSlide(current) {
    $(current).animate({
        backgroundColor:'#d6f4aa', color:'#eee'
    },40, function() {
        $(this).animate({backgroundColor:'#252525', color:'#fff'}, 500)
            doSlide($(current).next('li'));
        });

}
+2  A: 

The shortcut methods like slideUp dont take an object config as an argument.. they take the duration and the call back. If you want more advance options you have to use the animate method.

slideUp API

prodigitalson
do you know how to create the slide effect with .animate()? I don't know what the .animate() code would be to get it to slide open, or to get it to slide closed, without putting the height of the object directly into .animate(). is there a way of doing it without specifying the exact height?
android.nick
try `height: 'hide'` in your hash.
prodigitalson