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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Layer size setting

Status
Not open for further replies.

VJar

Programmer
Aug 3, 2002
18
UA
How can I set the size of layer in JavaScript?
My script works only after layers loading.
I need to set size of the layer before his
loading starts.
Help please

My script:

<html>
<head>
<title>Untitled Document</title>
</head>
<body>

<div id=&quot;layer1&quot; style=&quot;position:absolute; width=200px; height:154px;; left: 69px; top: 47px; background-color: #FF0000; &quot;>
</div>
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
document.all.layer1.style.width = 761;
document.all.layer1.style.height = 86;
</script>

</body>
</html>
 
Is this what you are looking for?

<html>
<head>
<title>Untitled Document</title>
</head>
<body>

<div id=&quot;layer1&quot; style=&quot;position:absolute;visibility:hidden; width=200px; height:154px;; left: 69px; top: 47px; background-color: #FF0000; &quot;>
</div>
<script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;>
document.all.layer1.style.width = 761;
document.all.layer1.style.height = 86;
document.getElementById('layer1').style.visibility = &quot;visible&quot;;
</script>

</body>
</html>

The div is invisible util the script resizes it so the user cannot see that it is beeing resized.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top