Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 04-23-2005, 02:51 PM Navigation problems.
Experienced Talker

Posts: 43
Trades: 0
Page: http://www.westeros.org/Citadel/Citadel-Frames.html
CSS: http://www.westeros.org/Citadel/Citadel-Frames.css
javascript: http://www.westeros.org/Citadel/Mouseover-Frames.js & http://www.westeros.org/Citadel/Menu.js

On the above page, I have the main menu on the left side. Clicking on any item in the main menu unhides the appropriate submenu on the right side. So far, so good (except in Opera). However, there's currently no way for visitors to tell which item out of the main menu they clicked on. And worse, once they click on an item from one of the submenus, they're taken to a new page which starts over with just the main menu displayed.

To improve the navigation, I'd like to do the following:

1) Once a user has clicked on an item from the main menu, I would like it to stay 'selected' (that is, showing the onmouseover version of the graphic) until another item on the main menu is clicked. I would also like to alter the pointer for that item to a standard arrow rather than the hand indicating a link.

2a) Once a user has clicked on an item from the currently active sub menu, which will load the index page of the chosen section, I would like that currently active sub menu to start off unhidden as the new page loads.

2b) As with the selected item from the main menu, I would like the selected item from the currently active sub menu to stay 'selected' (that is, showing the onmouseover version of the graphic) until another item on the main menu or the currently active sub menu is clicked. I would also like to alter the pointer for that item to a standard arrow rather than the hand indicating a link.

I have no idea if any of this is possible, however. 2a I could perhaps see solving with some sort of window.onload function that checks which section of the site a page belongs to (each submenu item corresponds to a folder), to determine if it should start out with a submenu loaded or not? I am not sure how I would go about checking that, however.
Linda is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-23-2005, 06:28 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
You will need to use some code to detect the pagename/folder using document.location or document.location.pathname and act on the return values.

Simple stuff server side but a bit more complex client-side
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-23-2005, 06:32 PM
Experienced Talker

Posts: 43
Trades: 0
Would using PHP be a better option than using javascript?
Linda is offline
Reply With Quote
View Public Profile
 
Old 04-23-2005, 06:39 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
absolutely
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-23-2005, 06:43 PM
Experienced Talker

Posts: 43
Trades: 0
Thanks.

Would you suggest using just php, letting it take over the hide/unhide part too, or combining it with javascript?
Linda is offline
Reply With Quote
View Public Profile
 
Old 04-23-2005, 07:03 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
it depends really, If the top level of your navigation is purely cosmetic and only there to open the menu, then do that client side. When a link is clicked then take over server side. To keep the menu collapse client side it's simply a matter of writing a variable value into the javascript. that way you can keep the cript external and set the values in the page
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-24-2005, 02:14 PM
Experienced Talker

Posts: 43
Trades: 0
Sounds complex, at least to my novice ears.

I'll post and ask for some advice in the php forum, though, to see if I can get started at least.
Linda is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Navigation problems.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36552 seconds with 12 queries