PDA

View Full Version : Preload images



Xiwl
02-05-2007, 03:53 PM
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

Xiwl
02-05-2007, 04:11 PM
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

Blob
02-05-2007, 04:50 PM
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?

Blob
02-05-2007, 05:22 PM
I got it from Dan

Drompo
02-05-2007, 05:42 PM
Just to be arkward

And where did Dan get it from..

Blob
02-05-2007, 05:52 PM
How am I supposed to know?

Xiwl
02-05-2007, 06: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
dont work.

Blob
02-05-2007, 06:40 PM
dont work.

Need to have <div id="content"></div> where the content loads

Xiwl
02-05-2007, 06:44 PM
still dont work lol

Xiwl
02-05-2007, 07:57 PM
*** someone help i need this to f'in work..

Want to hide these adverts? Register an account for free!