Uncaught TypeError with fadeIn in jQuery 1.9

后端 未结 2 945
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-21 09:17

Here is the problem, unfortunately we have to support IE8.
So I had to change from using the latest jQuery 2.0+ back to jQuery 1.9.

Now we use a lot of jQuery t

2条回答
  •  甜味超标
    2020-12-21 09:40

    $content.fadeIn('fast'); typically removes the object after it fades out while $content.show(); does not.

    I would recommend you use $content.animate({opacity: 1});

    Explore animate() for more options.

    EDIT: sorry opacity was set to 0 (fadeOut();), it's correct now: 1 (fadeIn();)

    EDIT2:

    It might be that the opposite is happening you are trying to use an object that hasn't been loaded yet.

    try this:
    $content.css({opacity: 0.1, display: block}).animate({opacity: 1});
    or
    $content.css({opacity: 0.1}).show().animate({opacity: 1});

    it loads the object with little opacity and then makes it to full opacity

提交回复
热议问题