BluePink BluePink
XHost
Servere virtuale de la 20 eur / luna. Servere dedicate de la 100 eur / luna - servicii de administrare si monitorizare incluse. Colocare servere si echipamente de la 75 eur / luna. Pentru detalii accesati site-ul BluePink.
enter page web design web resource entertainment personals  

Tricks: How to...
Image effects:
Preload images
Preload images 2
Swap images
Swap images 2
View larger image
Image transparency
Image slideshow
Special effects:
Border
Border 2
Watermark
Scroller
Scroller 2
Link hover color
Custom cursor
Snowing
Auto window resizer
Link tips
Popup
Buttons & menus:
Back button
Java buttons
Flat buttons
Slide menu
Drop down menu
Alphabet menu
Mouse effects:
Elastic mouse
Mouse snake
Mouse stars
Mouse orbit
Mouse eyes
Text generators:
Infobox
Quote generator
Fading messages
Text fader
Text glow
Credits

home > real world > web resource > web source codes >

::  L o a d i n g  ::

Because I wanted this page to stay in the same location and not be redirected, I used locationAfterPreload="#" instead of locationAfterPreload="your_next_page.html". To automatically redirect, use your_next_page.html for the next destination.

STEP 1/2: Put this code into the <HEAD> of your document:

<HEAD>
<script language="JavaScript1.2">
startingColor = new Array()
endingColor = new Array()
var yourImages = new Array ("gel01.gif", "gel02.gif", "gel03.gif", "gel04.gif", "gel05.gif", "gel06.gif", "gel07.gif", "gel08.gif", "gel09.gif", "gel10.gif")
var locationAfterPreload = "source_preload.html"
var preloadbarWidth = 300
var preloadbarHeight = 8
var backgroundOfGradient = "#99ff99"
startingColor[0] = "2"
startingColor[1] = "9"
startingColor[2] = "2"
endingColor[0] = "2"
endingColor[1] = "9"
endingColor[2] = "2"
var gap = 8 // minim 2
if (!document.all) location.replace(locationAfterPreload)
var a = 10, b = 11, c = 12, d = 13, e = 14, f=15, i, j, ones = new Array(), sixteens = new Array(), diff = new Array();
var convert = new Array("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"), imgLen = yourImages.length;
var loaded = new Array(), preImages = new Array(), currCount = 0, pending = 0, h = 0, hilite = new Array(), cover = new Array();
var num = Math.floor(preloadbarWidth/gap);
for (i = 0; i < 3; i++) {
   startingColor[i] = startingColor[i].toLowerCase();
   endingColor[i] = endingColor[i].toLowerCase();
   startingColor[i] = eval(startingColor[i]);
   endingColor[i] = eval(endingColor[i]);
   diff[i] = (endingColor[i]-startingColor[i])/num;
   ones[i] = Math.floor(diff[i]);
   sixteens[i] = Math.round((diff[i] - ones[i])*15);
}
endingColor[0] = 0;
endingColor[1] = 0;
endingColor[2] = 0;
i = 0, j = 0;
while (i <= num) {
   hilite[i] = "#";
   while (j < 3) {
      hilite[i] += convert[startingColor[j]];
      hilite[i] += convert[endingColor[j]];
      startingColor[j] += ones[j];
      endingColor[j] += sixteens[j];
      if (endingColor[j] > 15) {
         endingColor[j] -= 15;
         startingColor[j]++;
      }
      j++;
   }
   j = 0;
   i++;
}

function loadImages() {
   for (i = 0; i < imgLen; i++) {
      preImages[i] = new Image();
      preImages[i].src = yourImages[i];
      loaded[i] = 0;
      cover[i] = Math.floor(num/imgLen)*(i+1)
   }
   cover[cover.length-1] += num%imgLen
   checkLoad();
}

function checkLoad() {
   if (pending) { changeto(); return }
   if (currCount == imgLen) { location.replace(locationAfterPreload); return }
   for (i = 0; i < imgLen; i++) {
      if (!loaded[i] && preImages[i].complete) {
         loaded[i] = 1; pending++; currCount++;
         checkLoad();
         return;
      }
   }
   setTimeout("checkLoad()",10);
}

function changeto() {
   if (h+1 > cover[currCount-1]) {
      var percent = Math.round(100/imgLen)*currCount;
      if (percent > 100) while (percent != 100) percent--;
      if (currCount == imgLen && percent < 100) percent = 100;
      pending--;
      checkLoad();
      return;
   }
   eval("document.all.cell" + (h+1) + ".style.backgroundColor = hilite[h]");;
   h++;
   setTimeout("changeto()",1);
}
</script>
</HEAD>

STEP 2/2: Put this table into the <BODY> of your document:

<BODY>
<div align="center">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
   <tr><td width="400" align="center">:: L o a d i n g ::</td></tr>
   <tr><td width="400" align="center">
   <script language="JavaScript1.2">
   <!-- begin hiding
      document.write('<table border="1" bordercolor="#33bb33" cellpadding="0" cellspacing="1" width="' + preloadbarWidth + '"><tr height="' + preloadbarHeight + '" bgcolor="' + backgroundOfGradient + '">');
      for (i = 0; i < num; i++) {
         document.write('<td width="' + gap + '" id="cell' + (i+1) + '"></td>');
      }
      document.write('</tr></table>');
      document.write('<p>')
      loadImages();
   // end hiding -->
   </script>
   </td></tr>
</table>
</div>
</BODY>
© copyright 2004 - DigitalElf.ro - marian_dumitriu@yahoo.com