通过动画缓动向上滑动和向下滑动
我需要平滑的幻灯片效果,但我似乎无法理解我做错了什么。我已经尝试过以下操作,
$(document).ready(function(){
$('.drop2').click(function(){
var $next = $(this).parent().next('li.drop_down2');
if($next.is(':visible')) {
$next.animate( {'display':'none'}, 'slow', 'easeOutBounce');
} else {
$next.animate( {'display':'block'}, 'slow', 'easeOutBounce');
}
});
});
$(document).ready(function(){
$('.drop2').click(function(){
var $next = $(this).parent().next('li.drop_down2');
if($next.is(':visible')) {
$next.slideUp({
duration: 1000,
easing: easeInSine,
complete: callback});
} else {
$next.slideDown();
}
});
});
为了使这种顺利的效果发生,我是否做错了什么
I need a smooth slide effect and i cant seem to understand what I am doing wrong. I have tried the following
$(document).ready(function(){
$('.drop2').click(function(){
var $next = $(this).parent().next('li.drop_down2');
if($next.is(':visible')) {
$next.animate( {'display':'none'}, 'slow', 'easeOutBounce');
} else {
$next.animate( {'display':'block'}, 'slow', 'easeOutBounce');
}
});
});
$(document).ready(function(){
$('.drop2').click(function(){
var $next = $(this).parent().next('li.drop_down2');
if($next.is(':visible')) {
$next.slideUp({
duration: 1000,
easing: easeInSine,
complete: callback});
} else {
$next.slideDown();
}
});
});
Is there something I am doing wrong to make this smooth effect happen
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这应该可以帮助你开始,马特:
This should get you started, Matt: