setting visibility vs. hide/show

后端 未结 5 578
余生分开走
余生分开走 2021-02-07 01:02

What is the difference between element.css(\'visibility\', \'visible\') and element.show(). Also, what is the difference between element.css(\'vi

5条回答
  •  情书的邮戳
    2021-02-07 01:22

    jquery.hide() is equivalent to calling .css('display', 'none') and and jquery.show is equivalent to calling .css('display', 'block')

    The .css() method is just setting the visibility property.

    From the css point of view difference :

    visbility : hidden
    

    The value hidden makes the generated boxes invisible without removing them from the layout. Descendant boxes can be made visible. See this

    display : none
    

    A value of none makes the element generate no box at all. Descendant boxes cannot generate boxes either, even if their display property is set to something other than none.See this

    With hidden the element is still generated.

提交回复
热议问题