Jump to content

Weird Browser bug??!?!


efficacious

Recommended Posts

hey everyone,

 

I've been setting up a JS popup window that uses a div instead of an actual new browser window...

 

I've gotten it working but It seems to have a weird bug in it... If you leave the popup window up and tab through other tabs on the browsers or minimize it and then restore it.. the canceling background for the popup skrinks to half the screen width.. It does it so randomly it insane.. usually not until after the popup has been sitting on the page for awhile. like 5min or so.

 

here is the code below..

 

JS:

function openday(x)
{
document.getElementById('HDay').value=x;
document.getElementById('Hform').submit();
}

 

HTML:

<!-- HIDDEN FORM //-->
<form action='schedule.php' method='post' name='Hform' id='Hform'>
<input type='hidden' name='HDay' id='HDay' value='' />
</form>
<!-- HIDDEN FORM //-->

 

PHP:

$Hdata = (!(isset($_POST['HDay']))) ? '' : $_POST['HDay'];

////////////////////////
// Split And Count Id //
////////////////////////
$CountId=count(str_split($Hdata));

if($CountId==9)
{
$Strip1 = substr($Hdata,0,3);
$Strip2 = substr($Hdata,3,2);
$Strip3 = substr($Hdata,5,4);
}
elseif($CountId==
{
$Strip1 = substr($Hdata,0,3);
$Strip2 = substr($Hdata,3,1);
$Strip3 = substr($Hdata,4,4);
}
else{echo("ERROR!: ID is not valid![Counter]");}

if(isset($_POST['HDay']) && $_POST['HDay']!='')
{
include('checkday.php');
}

 

the checkday.php:

echo("
	<table id='Popper' name='Popper' align='center' width='99%' height='750px'>
		<tr>
			<td align='center' width='99%' height='99%'>
				<div id='PopDayTop'></div>
				<div id='PopDay'>
					<span style='font-size:xx-large;font-weight:bold;'>".$Strip1."-".$Strip2."-".$Strip3."</span><span style='float:right;position:relative;top:-55px;right:20px;cursor:pointer;' title='Close' onclick='closeday();'>x</span>
					<table width='99%'>
						<tr>
							<td width='99%'>

							<form action='schedule.php' method='post'>
							<table width='99%'>
								<tr>
									<td>StartTime:</td>
									<td>EndTime:</td>
								</tr>
								<tr>
									<td>
										<select name='DT_Start'>
											<option value='12:00am'>12:00am</option>
											<option value='1:00am'>1:00am</option>
											<option value='2:00am'>2:00am</option>
											<option value='3:00am'>3:00am</option>
											<option value='4:00am'>4:00am</option>
											<option value='5:00am'>5:00am</option>
											<option value='6:00am'>6:00am</option>
											<option value='7:00am'>7:00am</option>
											<option value='8:00am'>8:00am</option>
											<option value='9:00am'>9:00am</option>
											<option value='10:00am'>10:00am</option>
											<option value='11:00am'>11:00am</option>
											<option value='12:00pm'>12:00pm</option>
											<option value='1:00pm'>1:00pm</option>
											<option value='2:00pm'>2:00pm</option>
											<option value='3:00pm'>3:00pm</option>
											<option value='4:00pm'>4:00pm</option>
											<option value='5:00pm'>5:00pm</option>
											<option value='6:00pm'>6:00pm</option>
											<option value='7:00pm'>7:00pm</option>
											<option value='8:00pm'>8:00pm</option>
											<option value='9:00pm'>9:00pm</option>
											<option value='10:00pm'>10:00pm</option>
											<option value='11:00pm'>11:00pm</option>
										</select>
									</td>
									<td>
										<select name='DT_End'>
											<option value='12:00am'>12:00am</option>
											<option value='1:00am'>1:00am</option>
											<option value='2:00am'>2:00am</option>
											<option value='3:00am'>3:00am</option>
											<option value='4:00am'>4:00am</option>
											<option value='5:00am'>5:00am</option>
											<option value='6:00am'>6:00am</option>
											<option value='7:00am'>7:00am</option>
											<option value='8:00am'>8:00am</option>
											<option value='9:00am'>9:00am</option>
											<option value='10:00am'>10:00am</option>
											<option value='11:00am'>11:00am</option>
											<option value='12:00pm'>12:00pm</option>
											<option value='1:00pm'>1:00pm</option>
											<option value='2:00pm'>2:00pm</option>
											<option value='3:00pm'>3:00pm</option>
											<option value='4:00pm'>4:00pm</option>
											<option value='5:00pm'>5:00pm</option>
											<option value='6:00pm'>6:00pm</option>
											<option value='7:00pm'>7:00pm</option>
											<option value='8:00pm'>8:00pm</option>
											<option value='9:00pm'>9:00pm</option>
											<option value='10:00pm'>10:00pm</option>
											<option value='11:00pm'>11:00pm</option>
										</select>
									</td>
								</tr>
								<tr>
									<td colspan='2'> </td>	
								</tr>
								<tr>
									<td colspan='2'>
										Room:  
										<select name='DRoom'>
										<option title='Select A Room' value=''>Select A Room</option>
");
////////////////////////////
//* FIND AVAILABLE ROOMS *//
////////////////////////////
$RoomSQL="SELECT * FROM [".$datatable."] ORDER BY Room# ASC";
$RoomResult=mssql_query($RoomSQL);
$RoomCount=count($RoomResult);
$r=0;
while($row=mssql_fetch_array($RoomResult))
{
$R_ID[$r]		=$row[0];
$R_No[$r]		=$row[1];
$R_Description[$r]	=$row[2];
$R_Capacity[$r]		=$row[3];
$R_Amount[$r]		=$row[4];
$R_Type[$r]		=$row[5];
$R_Text[$r]		=$row[6];

if($R_Type[$r]=='0')
{
	$R_Type[$r]='No Charge';
}
elseif($R_Type[$r]=='1')
{
	$R_Type[$r]='Per Hour';
}
else
{
	$R_Type[$r]='Total Amount';
}

echo("<option title='".$R_Text[$r]."' value='".$R_ID[$r]."'>".$R_No[$r]." | ".$R_Description[$r]." | ".$R_Capacity[$r]." | ".$R_Amount[$r]." | ".$R_Type[$r]."</option>");

$r++;
}

echo("											</select>
									</td>
								</tr>
							</table>
							</form>

							</td>
						</tr>
					</table>
				</div>
				<div id='PopDayBot'></div>
			</td>
		</tr>	
	</table>

");

 

CSS:

/*****************/
/*** JS POP UP ***/
/*****************/
#Popper {
position:absolute;
background-image:url('imgs/breaker.png');
width:99%;
height:750px;
margin:0;
padding:0;
left:0px;
text-align:center;
vertical-align:center;
}
#PopDayTop {
width:473px;
height:30px;
background-image:url('imgs/dayTop.png');
}
#PopDay {
width:473px;
background-image:url('imgs/dayMid.png');
background-repeat:repeat-y;
}
#PopDayBot {
width:473px;
height:27px;
background-image:url('imgs/dayBot.png');
}

 

thanks for suggestions,

`eff

Link to comment
https://forums.phpfreaks.com/topic/122570-weird-browser-bug/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.