Need menu item to move menu position

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
don@markspp.com
Beginner
Beginner
Posts: 5
Joined: Sat Oct 18, 2003 12:22 am
Location: Texas, USA
Contact:

Need menu item to move menu position

Post by don@markspp.com »

I'm trying to get setup, and per Milonic "better practic" suggestion I'm attempting to rid my website of frames. Consequently, not all of my pages are layed out to accept a menu in the same position. I downloaded the sample that lets you move a menu via form controls which got my attention... But I'd like for users to be able to do this through the menu.

My testing page is at http://www.markspp.com/don/test.html and the bottom item "MOVE THIS MENU" will have sub-items "Top Left", Top Right" etc...

But when I make the respective functions

function topleft(){
_hpos="left"
_vpos="top"
updateScreenPosition()
}

I'm getting an error. I'd like the functions to be centralized so I don't have to put them in each and every page.

Thanks,
Don
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

If you are using updateScreenPosition "as is" from the sample page than you will definetly get errors. Andy has made that function very specific to that page as he hardcoded the form variable into it, the inputs, how those inputs set variables to affect the menu, etc. You need to definetly edit that function to make it do what you want. Once you have editted it, and still have errors, post up here what your code is.

Secondly, if you want to import all your functions into every page that uses the menu, the easiest thing to do would be to copy all your functions and paste them into the top of your menu_data file. just put the "function name(){...}" right at the top. But the cleaner and more scalable thing to do would be to have something like a common.js file that you put them in, and then just include that file into every page much like you do the menu scripts. That way you have a js file you can add to that every page has access to. Hope you get everything working.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
don@markspp.com
Beginner
Beginner
Posts: 5
Joined: Sat Oct 18, 2003 12:22 am
Location: Texas, USA
Contact:

Post by don@markspp.com »

Thanks, I played around with it some more and got it working... I passed the _vpos and _hpos vars as arguments and it liked that.

Don
Post Reply