Hi there.
I'm currently trying to have my site navigate by using ajax from jquery to load in a file from the server and replace the contents of the current page. The problem I'm having is that the layout of the newly retrieved html has yet to be formatted correctly by the browser before the user can see it. This is especially troublesome when images are concerned because before the image is loaded the browser doesn't know it's size and the content gets all shifted around once it has loaded.
Is there a way to load html content (including all images that it references) before displaying it?
Here is the website, the only 2 links that work are 'home' and 'new'. Pay attention to the flicker when you FIRST click 'new'. After it has loaded the first time it ends up looking really good, but this first time is horrible.
http://kdwebdesign.c...cts/andy_croft/
Any idea how I can solve this issue?
Thanks all!
Page 1 of 1
Loading content with ajax causes images and layout to flicker
#2
Posted 08 February 2012 - 03:11 PM
Just give all your images height and width attributes - http://www.w3schools...t_img_width.asp
Then the browser will know their size before rendering them.
Then the browser will know their size before rendering them.
#3
Posted 08 February 2012 - 03:29 PM
There are three ways to preload image content but the smallest and least code invasvive method is via the CSS see:
http://perishablepre...out-javascript/
http://perishablepre...out-javascript/
- ← jQuery Validation not working...
- CSS, XHTML/HTML & JavaScript
- 1 of my forms goes bonkers in IE but not FF or Chrome →
Share this topic:
Page 1 of 1
Help















