How to eliminate post-render “flicker”?

后端 未结 6 1364

I\'ve tried my best to be a purist with my usage of Javascript/Ajax techniques, ensuring that all Ajax-y behavior is an enhancement of base functionality, while the site is also

6条回答
  •  后悔当初
    2021-01-31 11:56

    Just like David said, you can add a Javascript, that adds a style sheet to hide all "unnecessary" html-elements:

    
      ...
      
    
    ...
    

    If Javascript is enabled, it sets all elements of class "disabled-if-javascript" to hidden, before the body is even loaded. Just add this class to all elements that need to be hidden, if javascript is enabled. You might also need a class enabled-if-javascript that does the opposite, to show certain elements that would be hidden for non-javascript. Maybe you need to add "!important" to your style definition there, to override the existing (non-javascript) rules.

提交回复
热议问题