你好,我想我的动画SlideToggle()它滑动起来慢,或我可以把时间,当我点击链接,请帮助。请参阅下面的代码。我试图把.slideToggle(“慢”),但不工作。我想要我的SlideToggle()慢或添加时间
$(function() {
$('#bottom_menu li a').click(function(e) {
e.preventDefault();
animateSlider(this.hash);
});
function animateSlider(hash) {
if (!$('#container div.open').length) {
if (hash == '#about') {
openPopup(hash);
}
if (hash == '#contact') {
openPopup(hash);
}
} else {
if (hash == '#about') {
openAndClose(hash)
}
if (hash == '#contact') {
openAndClose(hash)
}
}
}
function openPopup(hash) {
$(hash + '_popup').slideToggle().addClass('open');
}
function openAndClose(hash) {
if ($(hash + '_popup').hasClass('open')) {
$($(hash + '_popup')).slideToggle().removeClass();
} else {
$('#container div.open').slideToggle().removeClass();
$(hash + '_popup').slideToggle().addClass('open');
}
}
});
你是说它滑动而不是你想要的速度,也不会滑呢? – nnnnnn 2012-02-27 06:30:49
它滑动,但我不能把速度,我想要平滑和缓慢地滑动。 – moreinet 2012-02-27 06:39:30
你的“open”css类是什么?你也可以展示它吗? – denolk 2012-02-27 06:40:22