We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Preloading header images. | Forum

Topic location: Forum home » Support » General Questions
dave Leader
dave May 20 '13

I just thought since we can select the header image from the admin panel then it might be a good idea to have that setup either with an body onload, javascript, jquery, or some other kind of preload routine for the header image.   It would make the script load faster.

 

Just an idea..

 

 

Alia Team
Alia May 20 '13
Dave do you mind giving more info on how you see this?
Should there be an additional setting in admin panel>>upload header image where admin can specify when the image will be loaded

Or hardcode this into header?

Any additional info is appreciated.
dave Leader
dave May 21 '13

Sure,  no addtional option in admin is required, its all seemless and hard coded in the script.  All you do is run a preload routine as soon as the script loads so that when the index is first loading it preloads that header image so that the image is available in cache and ready to go when called for.   With some of the larger header images this will make the page load faster.

 

There are numerous ways to do this code wise, remembering that PHP is executed before any javascript.