到目前为止,我设法让它在点击时以 120 的增量向下移动,但我希望它向上和向下移动,而不是向下移动......我希望我已经解释了这一点,以便“某人”能够理解。
<script>
$(document).ready(function() {
$('#footertab').click(function() {
$('#footer').animate({
bottom: '-=120'
}, 1000, function() {
// Animation complete.
});
});
});
</script>
如果我做对了,您将需要切换页脚的位置。这可以通过 .toggle() 函数来完成:
$(document).ready(function() {
$('#footertab').toggle(function() {
$('#footer').animate({
bottom: '-=120'
}, 1000);
},function() {
$('#footer').animate({
bottom: '+=120'
}, 1000);
})
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)