EasyUI Forum
April 27, 2024, 02:42:21 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: hide page contents before UI is rendered?  (Read 13876 times)
eggbert
Newbie
*
Posts: 16


View Profile Email
« on: July 29, 2011, 12:28:08 PM »

Hi,

I notice that for really complex layouts, when the page first loads before the UI has fully rendered, it's showing the content of the page. Of course since the UI has not fully loaded it looks ugly. 

Is there a way I can hide the content of the page until the UI is fully rendered, so that users will never see the non-UI html?  I have experimented with setting body to display:none and then doing $('body').show();  when the document is ready, but then the UI components are not sized correctly.

Any ideas?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: July 29, 2011, 06:40:47 PM »

Hide body and when all UI has been rendered show body again, the code looks like this:

Code:
<script type="text/javascript">
$.parser.onComplete = function(){
$('body').css('visibility','visible');
};
</script>

<body class="easyui-layout" style="visibility:hidden">
<div region="north" style="height:100px"></div>
<div region="center"></div>
</body>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!