Performance differences between visibility:hidden and display:none

前端 未结 8 1078
一生所求
一生所求 2020-11-27 04:34

I want to simplify things in my jQuery Backbone.js web application. One such simplification is the behavior of my menu and dialog widgets.

Previously I created the

8条回答
  •  生来不讨喜
    2020-11-27 04:52

    I think this could be somehow related to this question: CSS Properties: Display vs. Visibility

    I'll just quote the interesting part:

    the element is NEVER removed from the DOM hierarchy. All block level display 'styles' are completely 'hidden' when using display:none, whereas with visibility:hidden; the element itself is hidden but it still occupies a visual space in the DOM.

    So there should be no real difference in regard to browser performance, because both versions are still in the DOM hierarchy. These properties only affect how an element is displayed in regards to the DOM.

提交回复
热议问题