Results 1 to 11 of 11

Thread: <div></div>

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Question <div></div>

    Hello,

    Please help me here. I have NEVER worked with these div tags, but what I want to do is display a message like "Loading please wait" and then the rest of my page.

    I have a page with a whole lot of select boxes which takes long to load and want to display a message while it all loads - something like..

    Code:
    .
    .
    .
    <div id="TranLoading" style="position:absolute; left: 0px; top: 0px; visibility: hidden">
    		<table height=100 width=100%>
    			<tr>
    				<td valign=bottom align=center>
    					<font face="Arial, Verdana, Helvetica" size=4 color=#001a70>
    					<b>Please wait!!</b>
    				</td>
    			</tr>
    		</table>
    	</div>
    
    
    <div id="tranloaded">
    
    //here I'll show all my select boxes
    
    </div>
    How do I do this??

    Thanks,
    T

  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    115
    First, set the TranLoading-layer to visible, and the TranLoaded to hidden...
    then use the onLoad-event for the body tag, and call a function which does:

    TranLoading.style.visibility = "hidden";
    TranLoaded.style.visibility = "visible";

    In netscape:

    document.layers["TranLoading"].visibility = "hidden";
    document.layers["TranLoaded"].visibility = "visible";

    This should be working. Let me know if there's any problem...

  3. #3
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    For netscape compatability you will need to detect which browser is being used and do a document.writeln() to write the DIV tag for IE or the LAYER tag for NS.

    Something like this:
    Code:
    if (document.all) //IE
    {
    	document.writeln("<div id=\"TranLoading\" style=\"position:absolute; left: 0px; top: 0px;\">");
    }
    else if (document.layers) //Netscape
    { 
    	document.writeln("<layer id=\"TranLoading\" pagex=\"0\" pagey=\"0\" width=\"200\" height=\"200\" z-index=\"100\" >");
    }
    And do the same for the ending DIV/LAYER tags


    And.... set Response.Buffer=False at the beginning of your ASP page do it displays the HTML as it hits it. Put the ASP script that hits your database AFTER your HTML that outputs the above message.
    Last edited by monte96; Jul 8th, 2001 at 10:52 PM.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343
    Thanks guys,

    As I said I've never used this before and still am in the dark a bit.

    Do I put this in the body onload tag/code??

    How do I do this.....

    Code:
    <body onload="TranLoading.style.visibility" ; bgcolor="#F1F2F5" text="black">
    How/where do I set the visibility to VISIBLE or HIDDEN??

    I know I'm being a bit thick here.................


    T

  5. #5
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Create a function that will be your handler for the window_onload event. In that function make the message DIV hidden. Don't stick code in the attributes. It makes your code harder to read and thus harder to maintain. Keep code in functions and just put the function names in the event handler attributes.

    Are you supporting Netscape? Cuz that opens a new can of worms on how to pull this off.
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  6. #6
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    monte96,

    your right, but NN6 does not use layer tag!,

    but most of all browser use div tag!!,


    it's mostly when you want to hide show of move layer:

    Code:
    function hideSubMenu()
    {
    	if(document.layers){
    		document.layers[lastMenuItem].visibility="hidden";
    		}
    	else if(document.all){
    		document.all[lastMenuItem].style.visibility = "hidden";
    		}
    	else if(document.getElementById){
    		document.getElementById(lastMenuItem).visibility="hidden";
    		}
    }

  7. #7
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    Great... that's one more reason to hate NS.....

    So did they break compatability with their previous versions or does it at least still support the layer tag?
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  8. #8
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    their previous still use layer tag!!

    but for some reason the nn6 version use div,

    i find that NN6 act more like MSIE than the previous version of NN,


    problably just to make it more complicated!!

  9. #9
    Frenzied Member monte96's Avatar
    Join Date
    Sep 2000
    Location
    Somewhere in AZ
    Posts
    1,379
    But.. does NS6 still allow the use of Layer tags? If not, then they have majorly hosed alot of formerly cross-compatible code...
    oOOo--oOOo
    __/\/\onte96
    oOOo--oOOo
    Senior Programmer/Analyst
    MCP
    [email protected]
    [email protected]


    Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..

  10. #10
    Frenzied Member sebs's Avatar
    Join Date
    Sep 2000
    Location
    Aylmer,Qc
    Posts
    1,606
    i don't think so,

    try it, layer in NN6 don't work,
    OR your have to use them differntly,

    maybe,

    i did not try but,

    i know that now they have style, so maybe you can do:

    <layer name="test" style="top:0;left:0;">

    cuz this don't position it like it suppose
    <layer name="test" top="0" left="0">

  11. #11
    Fanatic Member Psyrus's Avatar
    Join Date
    Jul 2000
    Location
    NJ
    Posts
    602
    Couldn't you just use window.open() in script tags to open a new window that says "Page Loading" then close it in the ONLOAD event of the main page?

    Just a thought...


    Chris
    Chris

    VB 6.0 Calendar App Video Gamers Group
    Don't forget to rate people if they helped you.

Posting Permissions

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



Click Here to Expand Forum to Full Width