Hi
I am trying to position a div in the center of the page. I have a function which finds the browser type and gets the height and width. How do I use this to display the div in the center of the page
function Browserinfo() {
var browserName=navigator.appName;
alert(browserName);
var browserVer=parseInt(navigator.appVersion);
alert(browserVer);
var fWidth;
var fHeight;
if (browserName=="Microsoft Internet Explorer")
{
fWidth = document.body.clientWidth;
fHeight = document.body.clientHeight;
alert("fWidth"+fWidth);
}
if (browserName=="Netscape")
{
fWidth = document.documentElement.clientWidth;
fHeight = document.documentElement.clientHeight;
alert("fWidth"+fWidth);
}
}
my div code
<div id="setaffiliates" style="display:none;position: absolute; padding:2px; width: 225px; left:30px; top:550px;">
</div>
thanks for your time
I am trying to position a div in the center of the page. I have a function which finds the browser type and gets the height and width. How do I use this to display the div in the center of the page
function Browserinfo() {
var browserName=navigator.appName;
alert(browserName);
var browserVer=parseInt(navigator.appVersion);
alert(browserVer);
var fWidth;
var fHeight;
if (browserName=="Microsoft Internet Explorer")
{
fWidth = document.body.clientWidth;
fHeight = document.body.clientHeight;
alert("fWidth"+fWidth);
}
if (browserName=="Netscape")
{
fWidth = document.documentElement.clientWidth;
fHeight = document.documentElement.clientHeight;
alert("fWidth"+fWidth);
}
}
my div code
<div id="setaffiliates" style="display:none;position: absolute; padding:2px; width: 225px; left:30px; top:550px;">
</div>
thanks for your time