Author Topic: A Preloader For 4image Gallery  (Read 3184 times)

0 Members and 1 Guest are viewing this topic.

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
A Preloader For 4image Gallery
« on: December 31, 2009, 07:58:49 AM »
Hey ! !

can we insert a preloader for our web 4imge web pages... for exmaple....

cant we set a preloader of for index.php and details.php
its because thier are lots of imges to get loaded... so if we hve a preloader ... the user can wait untill the pages are preloaded completely and start  browsing them ;)

it works handy !! !! can any1 help me please !

Code: [Select]
<!-- Cut-N-Paste JavaScript from ISN Toolbox
     Copyright 1996, Infohiway, Inc.  Restricted use is hereby
     granted (commercial and personal OK) so long as this code
     is not *directly* sold and the copyright notice is buried
     somewhere deep in your HTML document.  A link to our site
     http://www.infohiway.com is always appreciated of course,
     but is absolutely and positively not necessary. ;-)   -->
<html>
<head><title>Demo of "Zero Waiting Time" Preload Script</title></head>
<script language="JavaScript">
<!--
//vers = 1.0;
// -->
</script>
<script language="JavaScript1.1">
<!--
vers = 1.1;  // comment out this line to make it use a non-graphical status bar
// -->
</script>
<script language="javascript">
<!--
function initArray() {
 for (var i = 0; i < initArray.arguments.length; i++)
  this[i] = initArray.arguments[i];
 this.length = initArray.arguments.length;
}

// Define the pages you want it to preload here.
// Note that each of these pages must have a short bit of code
// at the top as shown in page1.htm.
var pages = new initArray(
 "page1.htm",
 "page2.htm",
 "page3.htm",
 "page4.htm");

var secondpage = "page1.htm"; // URL of second page goes here

function transfer(param) {
 location.href = secondpage;
}

function done() {
 for (g=0;g<pages.length;g++)
  eval('self.preload_frame'+g+'.location.href = "'+pages[g]+'";');
}

// preload the status bar images
if (vers >= 1.1) {
 blue = new Image();
 blue.src = "blue.gif";
 black = new Image();
 black.src = "black.gif";
}

var num_loaded = 0;

function update() {
 if (vers < 1.1) // non-graphical version
  self.topframe.document.stats.status.value += "||";
 else // graphic version
  eval('self.topframe.document.status'+num_loaded+'.src = "blue.gif";');
 num_loaded++;
 if (num_loaded == pages.length)
  transfer();
}

document.write('<FRAMESET FRAMEBORDER=NO BORDER=0 '
 + 'BORDERCOLOR="white" ROWS="*,0" FRAMESPACING=0>'
 + '<FRAME SRC="topframe.htm" name="topframe" SCROLLING="auto">'
 + '<FRAMESET FRAMEBORDER=NO BORDER=0 '
 + 'BORDERCOLOR="white" COLS="*');
for (g=1;g<pages.length;g++)
 document.write(',0');
document.write('" FRAMESPACING=0>');
for (g=0;g<pages.length;g++)
 document.write('<FRAME SRC="blank.htm" NAME="preload_frame'+g+'" '
  + 'SCROLLING="NO" NORESIZE>');
document.write('</FRAMESET></FRAMESET>');
document.close();

// -->
</script>
</html>


above is  code i found for preloading  web pge..can we apply this to 4images ? ? please help  8O

thnks in advance
I'm Back :)

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: A Preloader For 4image Gallery
« Reply #1 on: January 16, 2010, 01:27:25 PM »
can some1 help meeeeeeeeeeeeeeeeeeeeeeeeee  8O
I'm Back :)