Solved

Stopping flash before Jquery populated content

Posted on 2013-01-02
3
186 Views
Last Modified: 2013-01-10
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
Comment
Question by:Al4ddin2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 38736635
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
 

Author Comment

by:Al4ddin2
ID: 38736646
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
 
LVL 17

Accepted Solution

by:
jrm213jrm213 earned 500 total points
ID: 38736701
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question