Forum Moderators: not2easy

Message Too Old, No Replies

2 things not working , pls help

div disply top left position fixed

         

gidazzi

5:17 pm on Jan 24, 2004 (gmt 0)

10+ Year Member



Hi all,
Ive been working on this script for a long time now and Im getting hopeless. Im creating this div to let my user know Im processing something.
Im having 2 problems:
1) It's shifting my page elements when it shows up, how can I make it show up on top?
2) It's not respecting my top/left settings at all.

thx in advance,


<style type="text/css" media="screen">
body
{
overflow-y: hidden;
}
div.content
{
height: 100%;
overflow: auto;
}
</style>
<div id="divAguarde" style="display:none;position:fixed;top: 110px; left: 150px; z-index=2">
<table width="110" height="60" border="1" cellspacing="0" borderColor="#afc4d5" bgcolor="#99FFFF">
<tr><td align="center" width="100%">
<font size="3" color="#000066">
<b>Processing!</b>
</font></td></tr>
</table>
</div>
<script language="javascript">

function aguarde() {
// setPosition();
divAguarde.style.display = "";
}
function aguardeOff() {
divAguarde.style.display = "none";
}
function setPosition() {
divAguarde.style.top = 200;
divAguarde.style.left = 200;
}
</script>
</xsl:template>
</xsl:stylesheet>
<html >
<head>
<title>Teste centralizacao </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body >
<div class="content" >
<form action="" method="post">
<input name="aguardeButton" type="button" onClick="aguarde()" value="aguarde">
<input name="aguardeButtonOff" type="button" onClick="aguardeOff()" value="aguardeOff">
</form>
<table width="10%" border="4">
<tr>
<td></td>
<td>&nbsp;</td>
</tr>
</form>
</div>
</body>
</html>

BlobFisk

1:32 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Does moving the style information between the <head> and </head> tags make a difference?

Also, try using a Document Type Definition (DTD) [w3.org] on your page.

HTH

grahamstewart

1:44 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yep, you have some interesting ordering going on there.

<style>...</style> should be in the <head> section.
<script>...</script> should be in either <head> or <body>
The creation of divAguarde should also be in <body>

Also try specifying

position: absolute;
for your divAguarde (fixed doesn't work on IE anyway).

And I highly recommend you start using a validator to check your HTML code for you - it will teach you a lot about the language.
The W3C HTML Validator [validator.w3.org] is usually considered the definitive one.

domokun

1:49 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



your z-index should read

z-index: 2;

NOT

z-index=2;

i would also echo the opinions of the previous two posters.