JQuery:animate()在IE中没有按预期工作

我对这个IE 7感到疯狂……

==> hhttp://neu.emergent-innovation.com/

为什么以下功能在IE 7中不起作用,但与Firefox完全兼容?动画功能中是否有错误

function accordion_starting_page(){
    // hide all elements except the first one
    $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:not(:first)').css("height","0").hide();
    $('#FCE-Inhalt02-ContentWrapper .FCE-Fade:first').addClass("isVisible");

    $('div.FCE-Title').click(function(){

        // if user clicks on an already opened element => do nothing
        if (parseFloat($(this).next('.FCE-Fade').css("height")) > 0) {
            return false;
        }

        var toHide = $(this).siblings('.FCE-Fade.isVisible');

        toHide.removeClass("isVisible");

        // close all opened siblings
        toHide.animate({"height": "0","display": "none"},1000);

        $(this).next('.FCE-Fade').addClass("isVisible").animate({"height" : "200"},1000);

        return false;
    });
}

非常感谢您的帮助…

非常感谢,这些都是很好的提示!不幸的是,它仍然不起作用……

问题是IE显示两个容器的内容,直到动画结束…… Firefox表现正常……我认为这是“溢出:隐藏”的事情 – 但这并没有改变任何东西.

我已经尝试过手风琴插件,但它的表现完全一样……

最佳答案
如保罗所述,使用该方法时. Animate()jQuery IE7浏览器无法在内部识别属性“position”.例如

CSS规则:

li p (bottom:-178px; color: white; background-color: # 4d4d4d; height: 100%; padding: 30px 10px 0 10px;)

在jQuery中实现动画:

$('li').hover(function(){

              $this = $(this);

              var bottom = '-45px'; //valor default para subir.

              if( $this.css('height') == '320px' ){bottom = '-115px';}

              $this.css('cursor','pointer').find('p').stop().find('.first').hide().end().animate({bottom: bottom},{queue:false,duration:300});

      },function(){

         var $this = $(this);

         var bottom = '-178px'; //valor default para descer

            if( $this.css('height') == '320px' ){bottom = '-432px';}

         $this.find('p').stop().animate({***position: 'absolute'***,bottom:bottom},duration:300}).find('.first').show();

      });//fim do hover()

什么在所有浏览器中工作:

CSS规则:

li p (position: absolute; left: 0; bottom:-178px; color: white; background-color: # 4d4d4d; height: 100%; padding: 30px 10px 0 10px;)

JQuery代码

   $('li').hover(function(){

                 $this = $(this);

         var bottom = '-45px'; //valor default para subir.

              if( $this.css('height') == '320px' ){bottom = '-115px';}

              $this.css('cursor',function(){

         var $this = $(this);

         var bottom = '-178px'; //valor default para descer

            if( $this.css('height') == '320px' ){bottom = '-432px';}

         $this.find('p').stop().animate({bottom:bottom},duration:300}).find('.first').show();

      });//fim do hover()

就我而言,这是以这种方式解决的.

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: <span id=&quot...
jQuery 添加水印 <script src="../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...