Want to use jquery fade in effects, but want to use visibility:hidden initially

后端 未结 2 739
小蘑菇
小蘑菇 2021-01-18 11:01

It seems most of the jquery fadein/out and animate functions are based on the initial element having display:none as opposed to visibility:hidden.

What if I want the

相关标签:
2条回答
  • 2021-01-18 11:15

    You may also try something like this (Demo) as fadeIn

    $('div').css({opacity: 0, visibility: "visible"}).animate({opacity: 1}, 'slow');
    
    0 讨论(0)
  • 2021-01-18 11:26

    Sure, start with visibility: hidden then do:

    $('.your-element').css('visibility','visible').hide().fadeIn();
    

    Borrowed from a very similar question.

    0 讨论(0)
提交回复
热议问题