How to stop flash of unstyled content

后端 未结 3 2035
生来不讨喜
生来不讨喜 2020-12-15 13:30

This is just a short question, I don\'t really have an example but the I am using a bespoke cms and at present we have no access to the head of the web page so some css has

3条回答
  •  借酒劲吻你
    2020-12-15 13:43

    Add a class to the content named no-fouc, set the class to display: none in the common CSS file, then remove the class on page load. The advantage of this solution is that it handles an arbitrary number of elements and can be reused on all pages.

    $(function() {
      $('.no-fouc').removeClass('no-fouc');
      $('#dialog').dialog();
    });
    .no-fouc {
      display: none;
    }
    
    
    
    
    

    This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.

提交回复
热议问题