Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • Last Modified:

Stopping flash before Jquery populated content

Hi,

I am using JQuery to amend some content on my page depending on a querystring.
I am using $(document).ready to run it however there is a flicker while the page is loading then the dynamic content is displayed.
Is there a way to get round this?

I target a class called ".dynamicCall" where the content is shown.

Thanks
0
Al4ddin2
Asked:
Al4ddin2
  • 2
1 Solution
 
jrm213jrm213Commented:
Hi,

you could make the ".dynamicCall" area have either a style of display: none; or visibility: hidden; by default in your css, and then in the $(document).ready function after you have added the dynamic content, change the visibility css to visible or change the display css to block or inline whatever it needs to be for your page.

That way you shouldn't see anything there until it is loaded and ready to be displayed.
0
 
Al4ddin2Author Commented:
Hi,

I have changed it so that as default the content is empty. However this still seems to load last, so the page renders and then the dynamic content renders. So it still 'flashes' a little.

Is there a way to remove this? Or force it to load earlier?
0
 
jrm213jrm213Commented:
I am not exactly sure what you mean by "flashes" or "flickers" but the only thing I can think that might help, is if you have some idea of the height or width that the dynamic content will fill, then set those in your CSS and use visibility:hidden on the object until it is ready to be displayed.

Do you have a link we can look at to see what you seeing and better understand the situation?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now