ayah
ayah

Reputation: 23

slideToggle jQuery Speed

  <div class='sideBar'></div>
    <ul>
        <li><a href='javascript:void(0);'></a></li>
        <li><a href='javascript:void(0);'></a></li>
    <ul>    

var $sideBar = $('.sideBar'),
    $sideBarA = $sideBar.find('a');

$sideBar.on('click', function() {
    $sideBar.children('ul').slideToggle('linear');
});

$sideBarA.on('click', function(e) {
    e.stopPropagation();
});

There is no animate control in above code, Ayah want to add below line into jQuery above..how to implement this so Ayah can control slide toggle speed. Thanks in advance!

  $('').animate(,200);

Upvotes: 1

Views: 7794

Answers (1)

Alex
Alex

Reputation: 9041

Just add the speed:

$sideBar.on('click', function() {
    $sideBar.children('ul').slideToggle('500','linear');
});

Upvotes: 4

Related Questions