Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prepage for displaying please wait message 2

Status
Not open for further replies.

jwhite68

IS-IT--Management
Jun 14, 2007
77
BG
I have a main script which displays a preload 'Please wait..' message, before loading the rest of the page.
The problem is that it also shows a drop down box during the preload - which it shouldnt do.

The main script includes tempservices.php, which has the drop down box in it.

main script:

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>listing</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
	window.onload = function () { setTimeout('clearPreloadPage()',0); }
</script>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
	function clearPreloadPage() 
	{ //DOM
		if (document.getElementById)
		{
			document.getElementById('prepage').style.visibility='hidden';
		}
		else
		{
			if (document.layers)
			{ //NS4
				document.prepage.visibility = 'hidden';
			}
			else 
			{ //IE4
				document.all.prepage.style.visibility = 'hidden';
			}
		}
	}
// End -->
</SCRIPT>
<!--[if IE]>
<style type="text/css" media="screen">
 #menu ul li {float: left; width: 100%;}
</style>
<![endif]-->
<!--[if lt IE 7]>
<style type="text/css" media="screen">
body {
behavior: url(csshover.htc);
font-size: 100%;
}
#menu ul li a {height: 1%;} 
#menu a, #menu h2 {
font: bold 11px Verdana, arial, helvetica, sans-serif;
}
</style>
<![endif]-->
</HEAD>
<BODY>
<div id="prepage" style="height:100%;width:100%;z-index:500;text-align:center !important;position:absolute;font-family:Verdana;font-size:11px;left:0px;top:0px;background-color:White;layer-background-color:White"> 
<center>
<span style="font-size:14px;font-weight:bold">Please wait ..</span>
</center>
</div>
<center>
<table border="0" cellspacing="0" cellpadding="0" class="t874">
   <tr>
   <td>
	  <? include("tempservices.php"); ?>
   </td>
   </tr>
	<tr>
    <td>
		<br />
		<center>
		<a href="<?=$domain?>a.php" class="about">&nbsp;&nbsp;A</a>
		<a href="<?=$domain?>b.php" class="about">&nbsp;&nbsp;B</a>
		</center>
		<br />
		</td>
  </tr>
</table>
</center>
</BODY>
</HTML>


The script that is included (tempservices.php) which includes the drop down box:

Code:
<div class="offer1">
			<? if (!IsSet($find) or $find=="") { $find = 'products'; } ?>
			<div class="prodbut">	
				<form name="prods" method="post" action="" class="form10">
				<input name="find" id="find" type="hidden" value="<?=$find?>" />
				<a name="srv"></a>
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
					<tr>
						<td><a href="#srv"><img src="elements/services0.gif" border="0" name="imgServ" id="imgServ" onclick="requestServ()" /></a></td>
						<td><a href="#srv"><img src="elements/events0.gif" border="0" name="imgEven" id="imgEven" onclick="requestEven()" /></a></td>
						<td><a href="#srv"><img src="elements/products1.gif" border="0" name="imgProd" id="imgProd" onclick="requestProd()" /></a></td>
						<td>
							<select name="servcountry" id="servcountry" style="width:230px;margin:0px" onChange="requestLinks()">
							</select>
						</td>
					</tr>
				</table>
				</form>
			</div>
			
			<div class="products" id="DivProducts" name="DivProducts">
			<?
				
			?>
			</div>
</div>


When you execute the main script, you see the drop down box to the right of the 'Please wait..' text. You shouldnt. The drop down box should only be displayed when the 'Please wait..' prepage processing has completed.
Any ideas?
 
Hi

That means you use Explorer 6 or older. Because only those have that bug. You can not position anything above the [tt]select[/tt] control.

I saw a workaround somewhere which used a behavior script, but the essential was the same as you can do : initially give [tt]display: none[/tt] in the [tt]select[/tt]'s style, then reset it in the [tt]clearPreloadPage()[/tt] function.

Feherke.
 
Yeah, the easiest way is to not display the select box until the page loads.

Another workaround is to put a transparent iframe the size of your please wait div on top of the area over the div. The select box won't show through the iframe.

[monkey][snake] <.
 
Feherke - could you provide an idea of the code thats needed to reset it in the clearPreloadPage() function?
 
Hi

Code:
    function clearPreloadPage()
    { //DOM
        if (document.getElementById)
        {
            document.getElementById('prepage').style.visibility='hidden';
            [red]document.getElementById('servcountry').style.visibility='visible';[/red]
        }
        else
        {
            if (document.layers)
            { //NS4
                document.prepage.visibility = 'hidden';
                [red]document.servcountry.visibility = 'visible';[/red]
            }
            else
            { //IE4
                document.all.prepage.style.visibility = 'hidden';
                [red]document.all.servcountry.style.visibility = 'visible';[/red]
            }
        }
    }
Code:
                            <select name="servcountry" id="servcountry" style="width:230px;margin:0px[red];visibility:hidden[/red]" onChange="requestLinks()">
                            </select>

Feherke.
 
Feherke. You are a genius! That worked first time - you wouldnt believe how much time you've now saved me.
I cant thank you enough!

Fantastic!!

Many people have responded saying that it simply isnt possible (on other forums) and you have single handedly proved them wrong.

:)
 
Maybe you should "Thank feherke for this valuable post!" ?

[monkey][snake] <.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top