Solved

Stopping flash before Jquery populated content

Posted on 2013-01-02
3
181 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
  • 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

786 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