<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);
<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);
Share
Improve this question
asked Nov 28, 2014 at 9:08
ayahayah
231 silver badge5 bronze badges
2
- 2 Why is Ayah talking in the third person? – Alex Commented Nov 28, 2014 at 9:10
-
Ayah could provide 'normal' or 'slow' or 'fast' to
slideToggle
like this:slideToggle("slow")
:) – Abhitalks Commented Nov 28, 2014 at 9:10
1 Answer
Reset to default 4Just add the speed:
$sideBar.on('click', function() {
$sideBar.children('ul').slideToggle('500','linear');
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745075588a4609814.html
评论列表(0条)