EasyUI Forum
April 19, 2024, 06:26:02 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Layouts : content glitter/flash during page setup  (Read 3314 times)
fguibert
Newbie
*
Posts: 23


View Profile
« on: May 07, 2019, 02:46:21 AM »

Hi

I'm facing a graphical issue with my layout contents loading on screen :
I setup a basic layout with east, west and center regions : when I reload any page, we see for a short time the raw content (not rendered) of all the regions and buttons aligned on the left side of the screen, and disappear when the layout is rendered

--> Is there any way to mask this raw content until the layout framework and buttons are ready to be screened ?
(an option like "showContentOnReadyState" ?)

here's two screenshot to illustrate my words
thanks a lot

Logged
fguibert
Newbie
*
Posts: 23


View Profile
« Reply #1 on: May 07, 2019, 07:26:49 AM »

I finally found a simple solution :

- define html body invisible by default with CSS :

Code:
<style>
html { visibility:hidden; }
</style>

- set it visible on document.ready event (at the end of the page) :
 
Code:
<script>
$(document).ready(function() {
  document.getElementsByTagName("html")[0].style.visibility = "visible";
});
 </script>
Logged
andyj
Jr. Member
**
Posts: 57



View Profile
« Reply #2 on: March 23, 2023, 07:44:27 AM »

Thanks for that neat solution. Here's a slight modification to provide a brief fade-in.

Code:
<style>
  html { opacity:0; }
</style>
<script>
  $(document).ready(function() {
      document.getElementsByTagName("html")[0].style.opacity = 1;
      document.getElementsByTagName("html")[0].style.webkitTransition = 'opacity 1s 0s';
  });
 </script>
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!