View Full Version : Preload images
Is there anyway to preload images then show them all once they're loaded, instead of it loading up each one individually and showing the little loading image on each image, ty.
Drompo
02-05-2007, 04:10 PM
By using Javascript/AJAX and use a ajax loading image
By using Javascript/AJAX and use a ajax loading image
That kinda didnt help ;s
HOW
Drompo
02-05-2007, 04:18 PM
I'm only just learning it myself, I don't know the code but others will
Aflux
02-05-2007, 04:22 PM
There is a way by using
<body onload="blahblah"
I'm not sure of it but it's something like that.
Drompo
02-05-2007, 04:39 PM
<script src="javascript.js"></script>
<body onLoad="dopage('images.html', 'content')">
then create javascript.js and insert
function dopage(url, containerid){
document.getElementById("content").innerHTML = '<div align="center"><font size="1" color="#FFFFFF" face="verdana"><b>Loading</b>...</font></div><br><br>';
var page_request = false
if (window.XMLHttpRequest)
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar)
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}Something like that
Thats of PowerPod, which is off mine and Dans site btw.
Drompo
02-05-2007, 05:01 PM
i know, thats the only thing i could think of it on
Aflux
02-05-2007, 05:07 PM
Thats of PowerPod, which is off mine and Dans site btw.
And where did you get it from?
Drompo
02-05-2007, 05:42 PM
Just to be arkward
And where did Dan get it from..
How am I supposed to know?
<script src="javascript.js"></script>
<body onLoad="dopage('images.html', 'content')">
then create javascript.js and insert
function dopage(url, containerid){
document.getElementById("content").innerHTML = '<div align="center"><font size="1" color="#FFFFFF" face="verdana"><b>Loading</b>...</font></div><br><br>';
var page_request = false
if (window.XMLHttpRequest)
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar)
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}Something like that
dont work.
dont work.
Need to have <div id="content"></div> where the content loads
*** someone help i need this to f'in work..
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.