Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:27

Javascipt section attached to menu?


Poster: edweill
Dated: Wednesday May 26 2004 - 22:20:06 BST

On the left bar of my page I have the main nav menu and below that is a javascipt section which deals with login for the members only areas. This section determines if the person is logged in from data left in the header as window variables, and responds by writing either the login form and associated links, or the persons name and associated links.

I would like my menu to scroll with the page, since some of the pages get long. This results in the menu passing over the login section, which looks really bad. What I would like to see is the login section scroll with the menu so that they move together.

Is there some way to do this?

Ed


Poster: kevin3442
Dated: Wednesday May 26 2004 - 23:37:58 BST

Hi Ed,

Use a js conditional in the main menu definition to specify the aI(). In the aI() string, you essentially include the html code that you would normally use to create the tabe/form in the text= property. You'd also set type=html or type=form as appropriate. So, try adding the following (without the lin wraps) to your main menu definition:
Code:
if (window.loggedIn == '1') {
  aI("text=<table border='0' WIDTH='120' cellspacing='0' cellpadding='0' class='login'><tr><td><br>You are logged in as:<br>" + window.ufname + "<br>" + window.ulname + "<br><br><a href='javascript:trak(\"/register.shtml\")' class='login'>Edit my Profile</a></td></tr></table>;type=html;");
}
else {
  aI("text=<form name='login' action='#' method='get'><input type='hidden' value='login' name='formuse'><table border='0' width=120 class='login'><tr><td>username:<br><input name='username' type='text' size='12' maxlength='32'></td></tr><tr><td>password:<br><input name='password' type='password' size='8' maxlength='8'> <input type='image' src='/i/go-login.gif' value='submit' ></td></tr><tr><td><a href='javascript:trak(\"/login.shtml\")' class='login'>Forgot Password?</a></td></tr><tr><td><br><a href='javascript:trak(\"/register.shtml\")' class='login'>New Brokers,<br>register here</a></td></tr></table></form>;type=form;");
}

Before you test, remember to remove or comment out the code that you currently have in your html file that generates your table/form.

Kevin

Thanks


Poster: edweill
Dated: Thursday May 27 2004 - 15:25:31 BST

That worked great!

Thanks a bunch!