|
-
Jul 8th, 2001, 03:21 PM
#1
Thread Starter
Hyperactive Member
<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
-
Jul 8th, 2001, 04:34 PM
#2
Lively Member
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...
-
Jul 8th, 2001, 10:49 PM
#3
Frenzied Member
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..
-
Jul 9th, 2001, 01:29 AM
#4
Thread Starter
Hyperactive Member
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
-
Jul 9th, 2001, 11:03 AM
#5
Frenzied Member
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..
-
Jul 9th, 2001, 11:18 AM
#6
Frenzied Member
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";
}
}
-
Jul 9th, 2001, 12:59 PM
#7
Frenzied Member
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..
-
Jul 9th, 2001, 01:03 PM
#8
Frenzied Member
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!!
-
Jul 9th, 2001, 01:09 PM
#9
Frenzied Member
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..
-
Jul 9th, 2001, 01:20 PM
#10
Frenzied Member
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">
-
Jul 9th, 2001, 07:10 PM
#11
Fanatic Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|