Hi friends,
I have investigated a little about how to center a <div> element at different screen resolutions but unfortunately can’t get a working solution.
I have a <div id=”flashicerik”> with flash content.
I found and tried to modify logically a script:
[CODE]
<script language=”javascript” type=”text/javascript”>
[COLOR=”Blue”]winWidth[/COLOR] = parseInt((navigator.userAgent.indexOf(“MSIE”)!= -1) ? document.body.offsetWidth : window.innerWidth);
[COLOR=”Blue”]winHeigth[/COLOR] = parseInt((navigator.userAgent.indexOf(“MSIE”)!= -1) ? document.body.offsetHeigth : window.innerHeigth);
centerdiv = document.getElementById(‘flashicerik’);
w = centerdiv.style.width;
h = centerdiv.style.heigth;
xc=Math.round((winWidth-w)/2);
yc=Math.round((winHeigth-h)/2);
[COLOR=”Blue”]centerdiv.style.Left = xc + “px”;
centerdiv.style.Top = yc + “px”;[/COLOR]
</script>
but no effect….?
Need help