无法使用slideUp显示

无法使用slideUp显示

本文介绍了slideUp只隐藏吗?无法使用slideUp显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#bannerFijobottom:0px;处的固定横幅display:none,因此为了显示它,我应该slideUp(),但这似乎不起作用.

#bannerFijo is a fixed banner display:none at bottom:0px; so to show it I should slideUp() but it seems that this is not working.

<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>

(并且确实使用显示/隐藏)

(and it does using show/hide)

 <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中遇到错误.

to show it and I get an error in 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)

有人在这里看到替代品吗?

Does anybody see an alternative here?

这是该页面的屏幕快照,仅供参考.

Here is a screenshot of the page for reference.

推荐答案

您也许可以使用 animate 为此,取决于元素的位置和样式:

You might be able to use animate to achieve this, depending on the location and style of the element:

$('#bannerFijo').animate({ height: desiredHeight }, lengthOfAnimation, function() {
    //executes on completion
});

显然,您需要定义desiredHeightlengthOfAnimation.

这篇关于slideUp只隐藏吗?无法使用slideUp显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 08:37