DHTML menu positioning problem

Home » Forums » Free DHTML Menu Builder » DHTML menu positioning problem


Guest
9 posts

Hi all,

I have reviewed many of the posts here in the forum and have tried most if not all of the suggestions but nothing seems to work.

I have a menu that is postioned correctly on the page using the <span> tag however when the browser is resized it stills moves horizontaly on the page.
the verticle position stays put but the horizontal moves.

I will post the page to a server now so that it can be viewed.

Please understand that this is only a test page to get the bugs worked out. So most of the content is there for that purpose.

the link will be http://www.livingwordbaptistbogart.com/test.html


Senior Advisor
3,144 posts

Paul,

Here is some code from your test.html page:

<div id="navbar" align="center">
<span id="themenu">
<script type='text/javascript'>

The top line puts the menu in the center of the BODY of your page, or it puts the menu in the center of the browser window. Change that line by removing the align="center" and I think you will find that the menu is no longer moving as the browser window is resizing.

Bill R.
First Baptist Church
Brighter Day Charities
Roberson Family


Guest
9 posts

Thank you for the suggestion Bill, however this did not fix the problem.
it still moves horizontally as the page is resized.


Senior Advisor
3,144 posts

Paul,

It never fails. I look for the difficult and overlook the easy. If you look at the options you will see that you have horizontal position set to center.

That in itself should not be a problem, since I suspect you want the menu to have equal margins on each side, but do not want it to collapse as the browser width shrinks.

You need to use some CSS styling to set the minimum width of your page. Try putting this in your CSS file in the body section: min-width: 900px;
Right now the menu is centered in the browser window but the min-width may keep it from moving around. Bill R.
First Baptist Church
Brighter Day Charities
Roberson Family


Guest
9 posts

Nope still moves horizontally. there are some things that I have been thinking
about but have not had a chance to do. I am working at the moment so I can't dedicate a lote of time to this right now, but I am almost finished for the day.
I just have a couple of errands to run but when I return I will get back to this full time today.


Senior Advisor
3,144 posts

Paul,

I will likely be offline for a few days as I finish my finals for this semester.

Once I get some time, I can take a closer look and see if I can help locate the problem. Bill R.
First Baptist Church
Brighter Day Charities
Roberson Family


Guest
9 posts

ok, I am usually at home during the day as I work from home. I will be in and out of the forum during that time. One thing that I am noticing is that in the section that says do not edit there is a section that says:

function RePos(){
FrstWinWdth=ExpYes?FrstLoc.document.body.clientWidth:FrstLoc.innerWidth;
FrstWinHght=ExpYes?FrstLoc.document.body.clientHeight:FrstLoc.innerHeight;
ScWinWdth=ExpYes?ScLoc.document.body.clientWidth:ScLoc.innerWidth;
ScWinHght=ExpYes?ScLoc.document.body.clientHeight:ScLoc.innerHeight;
if(MenuCentered=='justify'&&FirstLineHorizontal){
FrstCntnr.style.width=FrstWinWdth;
ClcJus();
var P=FrstCntnr.FrstMbr,W=Menu1[5],i;
for(i=0;i<NoOffFirstLineMenus;i++){P.style.width=W;P=P.PrvMbr}}
StaticPos=-1;
if(TargetLoc)ClcTrgt();
if(MenuCentered)ClcLft();
if(MenuVerticalCentered)ClcTp();
PosMenu(FrstCntnr,StartTop,StartLeft)}

The third line from the bottom says if(TargetLoc)ClcLft();

if you go to this function in the code it seems to be telling it to set the menu to justify but I could be wrong.

I'm just trying to go through the code line by line to try to figure out what is causing the problem, but there again I am fairly new to HTML coding so I don't fully understand all of it. Also I do not want to change the code in this section as it says it will break the script.

I am trying to get this done for our church to convert a set of pages that was written by someone who is an old school DOS programmer and wrote the HTML code in notepad using nothing but tables. The church wants a more updated and graphical site so I am learning on the fly. Being a Network administrator I know about server side includes but I am having to learn CSS and HTML as I go.

thanks for all your help and May God Bless and Keep You.


Guest
9 posts

Sorry I miss quoted that line

the third line from the bottom says

if(MenuCentered)ClcLft();

and as I said that function seems to be setting it to justify.


Senior Advisor
3,144 posts

Paul,

Here are a couple of things to look at. In a message above, you said you were trying to get the OLD table code redone. That should be simple enough. I also suggest you NOT use positioning code. Different browsers may position things differently. Also, you need to use a valid doctype to make sure browsers are not in quirks mode.

Are you planning to use the DHTML menu on all the pages of your site? If so, you should use it as a javascript file. That will allow you to edit and upload the new menu without needing to edit every page.

While playing around with you code, I found the menu mis-behaving, so I suggest you download a replacement dat file which is a self extracting zip file with a readme and a replacement DAT.

Once you have replaced the DAT file(s), open the menu in the builder, and resave it. Copy the code to a new file, and remove everything above:

function Go(){return}

/***********************************************************************

and then remove everything below:

function BeforeStart(){return}
function AfterBuild(){return}
function BeforeFirstOpen(){return}
function AfterCloseAll(){return}

and save what is left as something like:
lwbc_menu.js

Now in your HTML code remove all the menu code and replace it with:

<span id="themenu">
<SCRIPT type="text/javascript" SRC="lwbc_menu.js"></SCRIPT>
</span>
<noscript>Your browser does not support script</noscript>

That will fix the menu, but you will still have problems due to your absolute positioning. I think I have a fix for that and will post another message here after I finish testing and here back that you have the dat file replaced.
Bill R.
First Baptist Church
Brighter Day Charities
Roberson Family


Guest
9 posts

I have replaced the dat file. There was only one of them in the DHTML menu folder. I intend to use the menu as a java script but was trying to work the bugs out before doing so. I have another test page that uses it as a java script but I am expereincing the same problems with this one. I am going to resave the menu to a new file now.

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.