|
Тема |
Re: Ми... [re: Beceлин] |
|
Автор |
ghs (познат) |
|
Публикувано | 17.03.06 00:08 |
|
|
<HTML>
<HEAD>
<title>Preloading images...</title>
<SCRIPT>
/*
Preload Images III- By Pok-Ching Lee (http://orion.spaceports.com/~lpok/index.html)
For this script and more, visit http://www.javascriptkit.com
*/
///////////////////////////////////////////////
// PUT ALL IMAGES IN AN ARRAY FOR PRELOADING //
///////////////////////////////////////////////
var pics = new Array("images/menu-bannerv3_08.jpg","images/altini.jpg","images/ciz2.jpg","images/menu-bannerv3_04.jpg","images/menu-bannerv3_05_tr.jpg");
///////////////////////////////////////////////////
// ENTER URL TO GOTO AFTER IT FINSHES PRELOADING //
///////////////////////////////////////////////////
var url = "fiyat.html";
////////////////////////////////////////////////////
// ASK USERS TO GO TO NEXT PAGE AFTER PRELOADING? //
////////////////////////////////////////////////////
var doConfirm = true;
////////////////////////////////////
// ALLOW USER TO SKIP PRELOADING? //
////////////////////////////////////
var canSkip = true;
////////////////////////////////////////////////////////////////////////////////////
//------------YOU ARE DONE, DON'T EDIT ANYTHING BEYOND THIS POINT-----------------//
////////////////////////////////////////////////////////////////////////////////////
var imgObjs = new Array(pics.length);
var loaded = 0;
var total = pics.length;
var cPercent = 0;
var barLayer = null;
var percentLayer = null;
var statLayer = null;
var doneMsgLayer = null;
function getLayer(layerID) {
if (document.getElementById)
return document.getElementById(layerID);
else if (document.all)
return document.all[layerID];
else
return null;
}
function updateBar() {
statLayer.innerHTML = "<font face=\"Arial\" color=\"#FFFFFF\"><B>" +loaded+ "/" +total+ "</B></font>";
var percent = Math.round(loaded/total * 100);
if (cPercent != percent)
{
cPercent = percent;
barLayer.style.width = (cPercent*3) +"px";
percentLayer.innerHTML = "<font color=\"#BBBB00\"><B>" +cPercent+ "%</B></font>";
}
if (loaded == total)
{
doneMsgLayer.innerHTML = "<a href=\"javascript:done()\"><font face=\"Arial\" color=\"#FFCC00\" size=\"2\"><B>Done (Click Here)</B></font></a>";
if (doConfirm && confirm("Files have finish loading, continue to next page?"))
done();
}
}
function startLoading() {
if (document.getElementById || document.all)
{
barLayer = getLayer("bar");
percentLayer = getLayer("percent");
statLayer = getLayer("stat");
doneMsgLayer = getLayer("doneMsg");
if (canSkip)
doneMsgLayer.innerHTML = "<a href=\"javascript:done()\"><font color=\"#FFCC00\" size=\"2\" face=\"Arial\">Skip Pre-Loading</font></a>";
for (i=0; i<pics.length; i++)
{
imgObjs = new Image();
imgObjs.onload = imgLoaded;
imgObjs.onerror = imgFailed;
imgObjs.src = pics;
}
}
else
{
window.location.replace(url);
}
}
function done() {
parent.window.location.replace(url);
}
function imgFailed() {
alert("The following image failed to load, probably a broken link:\n" +this.src+ "\nPlease contact the webmaster of the site you are visiting about this. The program will skip this file now.");
loaded++;
updateBar();
}
function imgLoaded() {
loaded++;
if (loaded>pics.length)
return
updateBar();
}
window.onload=startLoading
</SCRIPT>
</HEAD>
<BODY bgcolor="#4D4D4D">
<center><FONT face=Arial color=#dddddd size=4>Preloading images. Please stand by...</FONT></center>
<DIV id=bg
style="LEFT: 200px; WIDTH: 300px; POSITION: absolute; TOP: 50px; HEIGHT: 20px; BACKGROUND-COLOR: #dddddd"></DIV>
<DIV id=bar
style="LEFT: 200px; WIDTH: 1px; POSITION: absolute; TOP: 50px; HEIGHT: 20px; BACKGROUND-COLOR: #000000"></DIV>
<DIV id=percent style="LEFT: 330px; POSITION: absolute; TOP: 50px"><FONT
color=#bbbb00><B>0%</B></FONT></DIV>
<DIV id=stat style="LEFT: 520px; POSITION: absolute; TOP: 50px"><FONT face=Arial
color=#ffffff><B>0/0</B></FONT></DIV>
<DIV id=doneMsg style="LEFT: 620px; POSITION: absolute; TOP: 50px"></DIV>
<!--Rest of text...-->
</BODY></HTML>
|
| |
|
|
|