Results 1 to 2 of 2

Thread: Another Question on the Preload Image Script

  1. #1
    Join Date
    Sep 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Another Question on the Preload Image Script

    1) Script Title: Preload Image (with progress bar) Script

    2) Script URL (on DD):http://www.dynamicdrive.com/dynamici...eloadimage.htm

    3) Describe problem:No Problem

    I was just wondering if there is any way I can make the script stop after pre-loading images and have an enter button to enter the site instead of automatically going into it....

    Thanks for all the help

    Patrick

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Change the function checkLoad() to:

    Code:
    function checkLoad() {
    	if (currCount == preImages.length) { 
    		var enterButton=document.all? document.all['ebut'] : document.getElementById('ebut');
    		enterButton.style.display='visible';
    		return
    	}
    	for (i = 0; i <= preImages.length; i++) {
    		if (loaded[i] == false && preImages[i].complete) {
    			loaded[i] = true
    			eval("document.img" + currCount + ".src=dots[1].src")
    			currCount++
    		}
    	}
    	timerID = setTimeout("checkLoad()",10) 
    }
    And add this button wherever you like to the body of the page:

    HTML Code:
    <input style="visibility:hidden;" id="ebut" type="button" value="Enter" onclick="window.location.replace(locationAfterPreload);">
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •