Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I think I need help with a Focus 1

Status
Not open for further replies.

okpeery

Instructor
Dec 29, 2005
102
US
I wish my subnavigation menu would stay on when the main navigation menu is selected, even if I accidentally hover over another main menu item.

For example
If I click on Glass, I would like the 3 sub nav menu items under Glass to remain in place until I actually click on another main menu item not just hover over it. I think what I am looking for is focus. I don't want just hovering to change the sub nav. I should have desinged with this in mind from the beginning but I didn't. Can it be changed reasonably easily?

 
Your page does not load for me so I cannot say how easy or difficult it would be (I don't know how you did the hover thing). But I guess you would play with :focus (regular browsers) or :active (IE) pseudo classes instead of :hover.
 
Apparently I need help with a bit more than just active or focus. I guess I really have to specify. I thought a browser would look for an index page, so the link is

I don't understand why when I previewed my last post and I tested the link, it worked, but no one was able to access the page? Anyway, I tested the link, it works, I hope I have done it right now. Thanks Vragabond for not giving up on me.
 
I thought a browser would look for an index page...
Your browser doesn't look for anything. Your webserver serves up a default page or page order (check with your provider); it could be index.htm or .html (though apparently not in this case), home.htm, default.htm, followed (or preceded by) index.php, index.asp, etc.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Phew, finally we can see the page. Too bad, it won't be an easy fix. First of all, rather than using a simple CSS based :hover effect you're using a JS solution to show your submenu. Either go to forum216 to make changes to that or preferably just redo your menu. Second, your main menu options are links on their own. So, if you click on them, they will take you to their respective page, rather than just show the submenu. I don't know what your plan to allow for both operations at the same time.

Your solutions?
1. Don't do the immediate submenu. Just have one menu and when appropriate option is chosen, reload the page showing the appropriate submenu. This will require server side logic, if you're using server side scripting or simply changing the respective html page to show it correctly.
2. Abandon the links in top navigation, switch from using JS to CSS for showing the submenu and modify the code to use :focus and :active instead of :hover.
3. Keep it the way it is.
 
I'm leaning toward 3 because I am sick of working on this. I have learned a lot, made a lot of mistakes, and will know how to better plan and implement said plans for my next site adventure, BUT

If I were to look into a CSS approach, that kept the same basic structure I already have, would you have a link for me to visit to see if it is worth the time right now?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top