...

View Full Version : Need to center flash menu.



The_Table_File
03-09-2009, 06:09 AM
Hi,
I have a program that built me a flash menu, but it doesen't have a function to center it. I want the menu to be centered at the very top of the page, my coding skills are too limited for this. I hope someone here can help.

View the code online:

http://znasimov.tripod.com/the_file/Code.txt

Thanks in advance.

roeyfreak10
03-09-2009, 06:42 AM
why dont you just create a div and place it in that ... ?




<html>
<body>
<div id="flashmenu">
function AdjustMenu(pobjName,pblnCenter,pintLeft,pintTop) {
var w_newWidth,padding,xoffset;

if (navigator.appName.indexOf("Microsoft") != -1) {
w_newWidth=(document.documentElement.clientWidth == 0)?document.body.clientWidth:document.documentElement.clientWidth;
xoffset=21;
}else{
w_newWidth=document.documentElement.clientWidth;
xoffset=17;
}
if (pblnCenter=='true'){
document.getElementById(pobjName).style.left=(w_newWidth-parseInt(document.getElementById(pobjName).style.width))/2+'px';
}else{
padding=parseInt((window.screen.width-xoffset-parseInt(document.getElementById(pobjName).style.width))/2-pintLeft);
document.getElementById(pobjName).style.left=(w_newWidth-parseInt(document.getElementById(pobjName).style.width))/2-padding+'px';
}
if (parseInt(document.getElementById(pobjName).style.left)<0)
document.getElementById(pobjName).style.left='0px';
document.getElementById(pobjName).style.top=pintTop+'px';
}
</div>
</body>
</html>




then for the css



#flashmenu {
margin: 0 auto;
width:how ever many pixles;
height: how ever many pixles;
}

The_Table_File
03-09-2009, 06:51 AM
Thank you very much, but there seems to be a syntax erron in row 5, the main code, not the cascading style sheets.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum