Difference between jQuery .hide() and .css(“display”, “none”)

后端 未结 7 1147
既然无缘
既然无缘 2020-12-12 14:33

Is there any difference between

jQuery(\'#id\').show() and jQuery(\'#id\').css(\"display\",\"block\")

and

jQuery(\'#id\').         


        
7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-12 15:11

    You can have a look at the source code (here it is v1.7.2).

    Except for the animation that we can set, this also keep in memory the old display style (which is not in all cases block, it can also be inline, table-cell, ...).

提交回复
热议问题