Example Code for CSS Menu Current...

User 445977 Photo


Registered User
81 posts

Howdy do,

first:

http://www.the-web-seeker.com/Reg70Reg3k/

All of my work here is contributed to help this music forum to
whom I owe a great deal...Its Specifically for Yamaha PSR/TYROS
keyboard learning and sharing...

The owner started his efforts about 7 years ago and has spread
a lot of good knowledge thru-out the world...
He was/is not too wild about Flash menu's the maintenance aspects.
Albeit he is the person who put me onto CC products...

Anyway, this is where my "bug" do get into HTML etc. started couple
of years ago...

My current project is a set of Lessons for PSR 3000 Registration Use for Beginners...
I started writing it last Oct. to help a friend, with learning disabilities and it evolved...

PSRTUTORIAL.COM site has hundreds of Tech support pages
for these keyboards and the owner built and in turn maintains it free of charge...
Probably the best Yamaha Website in the world for "mission" and
also its heavy use, and very active forum...

Enough of the history... Late Dec 07 I dumped about 27 pages of
code that would make you turn White... so crappy...

After purchasing the CC mega developers pak... the VSD put me
in a position to clean up the code generate the BASE CSS code

I then took this code and place a "shell" of CSS menu's based
Templates... Several sources.. I modified them quite a bit...
There is a lot I still dont know, but the reason for the
long post is this...

1. I want to be able to show the CURRENT button on the page
being used. Some of the menu's had a indication of this
code, but was a FIXED entity... The button "lit" up was
static.. and additional buttons would only show Hover...
a couple of the menus show a "residual" indication of
being current...

Need some code examples on how to do this... W3C on CSS has
some "grey" talk about it... but never really nails it down..

2. Also maybe this is part of my mistake and truly being lost..
Does the STYLE.INI need to be used with the menu files...
Never calls it out....

I've spent many hours looking trying and experimenting on getting
this to work... Nodda...

Thank you in Advance,

Seeker
"Our Home is Over the next Hill" Johnny Cash
User 445977 Photo


Registered User
81 posts

Howdy do,

I have pretty much completed the Music project from above..

http://www.the-web-seeker.com/Reg70Reg3k/

Its going to be moved into it permanent home very soon..

I did use the CSS menu's with some amount of work
but very happy with it..Plain Jane, nothing real
fancy, but very functional and clean...

Now to answer my own question... with some amount
of GOOGLING and accidental finds...

An external PHP file is used to mark the CURRENT button
in the CSS menu... the PHP actually modifys the
HTML code moving an ID pointer to CURRENT button location.

I have not learned how to do it, but this is Fact..

Of course most of you this is probably old news....
The CSS related STYLE.INI is somehow linked to this..
It maybe an intermediary in the process. Think .ini
is actually windows setup code...

Thank you,

Seeker
"Our Home is Over the next Hill" Johnny Cash
User 364143 Photo


Guest
5,410 posts

This site is the definitive site for nav lists and you should find it very useful.

http://css.maxdesign.com.au/listamatic/

If you are using CSS lists for rollover effects, what you are looking for is the current or active id.

On a different note, you can always place an inline tag for that <a href""> tag that has a style attribute. Inline styles override other styles.

So if all your links had a white background and you wanted the current page to have a different color background for the current page link, you would insert an inline style attribute like so <a href"" style="background-color="#8b0000;">Home</a>, and so on for each page.
CoffeeCup... Yeah, they are the best!
User 445977 Photo


Registered User
81 posts

Tom,

I dont fully understand but will definitely look into it...
I do not like External program modifying my HTML...
I do not have enough experience with html and support languages
on Solidarity of their operation.... I want code that functions
absolutely same every time.... Like the idea..

Also thanks for the link will go there in a few minutes.

Again thank you,

Seeker
"Our Home is Over the next Hill" Johnny Cash
User 445977 Photo


Registered User
81 posts

Tom,

Eureaka... so to say...

I took your suggestion and went a bit
further... I knew there was code in the
CSS file for Current...

By using the models...for the CSS menus...

I ended up editing each HTML page inserting
id="current"... Into each HTML file for
which the button was named... worked like a champ.

http://www.the-web-seeker.com/Reg70Reg3k/

is my work again.. left menu is where I used it..
Dont have access to other menu destination HTML's.

If you do a view source after you use the left menu..
Scroll down to the large HREF cluster...
You'll see the id="current" edits...

Extracted line of code...

<li><a id="current" href="index.html">Introduction</a>

etc., etc.... for other html's

Tom, you really helped me nail this down..
Was doing a little Snoopy dance this morning...

Thank you again,

Seeker
"Our Home is Over the next Hill" Johnny Cash
User 364143 Photo


Guest
5,410 posts

I'm glad it worked out for you. Looks good.
CoffeeCup... Yeah, they are the best!

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.