Javascipt section attached to menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
edweill
Beginner
Beginner
Posts: 9
Joined: Wed May 26, 2004 4:42 pm

Javascipt section attached to menu?

Post by edweill »

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
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

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: Select all

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
edweill
Beginner
Beginner
Posts: 9
Joined: Wed May 26, 2004 4:42 pm

Thanks

Post by edweill »

That worked great!

Thanks a bunch!
Post Reply