#bannerFijo是bottom:0px;的固定横幅display:none,所以为了显示它,我应该使用slideUp(),但这似乎不起作用。
<script type="text/javascript">
function mostrar_banner() {
$('#bannerFijo').slideUp();
}
function ocultar_banner(){
$('#bannerFijo').slideDown();
}
$(document).ready(function() {
mostrar_banner();
$('#bannerFijo .close').click(function() {
ocultar_banner();
});
});
</script>(它使用显示/隐藏来实现)
<script type="text/javascript">
function mostrar_banner() {
$('#bannerFijo').show();
}
function ocultar_banner(){
$('#bannerFijo').hide();
}
$(document).ready(function() {
mostrar_banner();
$('#bannerFijo .close').click(function() {
ocultar_banner();
});
});
</script>我试过了
$('#bannerFijo').show("slide", { direction: "up" }); 来显示它,但我在jquery.min.js中得到了一个错误。
o.easing[this.options.easing || (o.easing.swing ? "swing" : "linear")] is not a function
[Detener en este error] (function(){var R=/((?:\((?:\([^()]+\)...ypeof K==="string"?K:K+"px")}})})();
jquery....min.js (línea 31)有没有人看到另一种选择?
以下是该页面的屏幕截图以供参考。

发布于 2011-08-19 19:57:18
根据元素的位置和样式,您可以使用animate来实现这一点:
$('#bannerFijo').animate({ height: desiredHeight }, lengthOfAnimation, function() {
//executes on completion
});显然,您需要定义desiredHeight和lengthOfAnimation。
发布于 2011-08-19 20:00:54
你有没有尝试过用slideDown来显示,用slideUp来隐藏?即使你寻找的东西在意义上是相反的..
当你在底部有元素的时候,你做了slideDown,这是一个带有“滑动”效果的展示事件。因为它在底部,所以动画显示在相反的位置。至少对眼睛来说是这样。但它实际上是向下滑动的,因为它撞到了底部,所以它上升了。
编辑:此处jsFiddle示例:http://jsfiddle.net/fddpp/
发布于 2011-08-19 20:14:52
尝试使用slideToggle();
可能类似于:http://jsfiddle.net/SCgdy/14/
https://stackoverflow.com/questions/7121147
复制相似问题