jQuery and screen manipulation flickering


We’re doing quite some jQuery improvements to our SharePoint developments such as inserting navigation for document libraries, reordering elements, hiding menu actions, etc. and one of the big issues is that the jQuery action occurs “on document ready” and the end user might see the manipulation happening if the javascript execution is just a bit delayed.

One of the solutions we’re using is to set the body hidden using CSS on load and then in our jQuery show it again as follows:

<style type="text/css">
body
{

display:none; }
</style>

<script type='text/javascript'>
$(
  function()
  {
    /* Your script) */

    /* Show rendered page */
    $('body').css('display', 'block');


  }
);
</script>

Works like a treat btw, but maybe any of you have a better way ?

 


Links to this post

Comments

CAPTCHA Image Validation