dynamic positioning of layers

by Andrew Browne <andrew(at)pbm.co.za>

 Date:  Tue, 1 Aug 2000 13:21:10 +0200
 To:  "'hwg-languages(at)hwg.org'" <hwg-languages(at)hwg.org>
  todo: View Thread, Original
Hi all

I would like a layer to pop up in the centre of the screen in response =
to a certain user event.  I'm not sure, however, of the best means of =
centering the layer.  I've created a JavaScript to get the left and top =
values but don't know how to write them into the style.  Like so:

<html>
<script language=3D"JavaScript" type=3D"text/javascript">
//get the screen poitions for the 'pop-up' layer
var leftSide, topSide
leftSide =3D (screen.width - 400) / 2
topSide =3D (screen.height - 300) / 2
</script>=20

<head>
<title>Aid for AIDS: Letters</title>
<style>
#reasonCode {position: absolute; left: what's here; top: what's here;}
</style>
</head>

How can I write the values of the leftSide and topSide variables into =
the layer's left and top properties?

Thanks
_____________
Andrew Browne
IT
658-6484        =20
_____________

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.