Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    Brighton, UK
    Posts
    282
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Lightbulb show a div on load then hide when loaded. control the downloading of specific DIVS

    I am hoping to show a div when The page is loading, and once it has loaded this will fade away.. is it possible with the power of js + dom to do this... have a div with a 50 per alpha filter so you can see the page loading below but can't use any of the site until the div Hides after loading ????

    the div will cover the screen.. with a grey tint

    I have been thinking of doing it like this

    function hideload() {
    loadingdiv.style.visibility="hidden";
    }
    -->


    <body onLoad="hideload()">
    <DIV ID="loadingDiv">
    </DIV>



    I think this is a bad way of doing it...... but I would like a 50 per filtered layer of one colour to go over the top of the page... then fades out when The page is loaded... plus text on this div.. I have been trying..

    can you say: to open a specific division first the every thing casading below opens afterwards.. or control the way that division load ???

    <marquee>thanks</marquee>

  • #2
    Regular Coder
    Join Date
    May 2002
    Location
    Maine, USA
    Posts
    573
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, something like this script? Click "View script" to the left to see it in action, you might be able to get some ideas by looking throught he source. Good luck .
    boxer_1
    CodingForums Moderator
    "How did a fool and his money get together in the first place?"

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    Western US
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Probably the best you could hope for is to put the loading div first, then a content div after. The browser would then render the first div, and it could sit there while it renders the rest of the page. This seems to work when I do a large select from a database and then form it into a large table. At wich point you could begin to fade it. Something like this...

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    function fadeInPage() {
    	if (document.getElementById("loadingDiv").filters.alpha.opacity > 0){
    		document.getElementById("loadingDiv").filters.alpha.opacity -= 10;
    		eval('setTimeout("fadeInPage()",100)');
    	}
    	else{
    		document.getElementById('loadingDiv').style.visibility = "hidden"
    	}
    }
    </script>
    then onLoad call the fadeInPage to delay that you could setTimeout on load as well to give it half a second or soemthing before it starts to fade in. The final hidden bit will then allow the user to "click through" the loading tag.

    The filter/apha bit is only supported in IE though.

    ShriekForth

  • #4
    Regular Coder
    Join Date
    Jul 2002
    Location
    Brighton, UK
    Posts
    282
    Thanks
    1
    Thanked 0 Times in 0 Posts

    ;) that is beutiful

    wow. it was perfect.. I am a happy man.. thank you


    cheers ShriekForth...


    you should be happy in the knowledge you are knowledgeable
    <marquee>thanks</marquee>


  •  

    Posting Permissions

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