PDA

View Full Version : Switch Menu- Javascript and CSS Question



Cheng
08-29-2007, 03:39 AM
Hi.

I'm trying to configure this Switch Menu from the libary and I want that the submenus that contain only one link in it don't open up a submenu and just work as a straight link.
The thing is that I want these links to look like the other ones and that there is no color change or underline on hoover.
I'm trying for days now but can't manage to get it work.
Please give me some advise.
The menu is attached or can be seen here:

Switch Menu (http://www.tommys-service-enterprise.gmxhome.de/test/Menu.html)

The links in question are Menu 3, 5, 6, and 7.

Thanks in advance,
Cheng

jscheuer1
08-29-2007, 07:17 AM
Your page is in violation of Dynamic Drive's usage terms (http://www.dynamicdrive.com/notice.htm), which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.

Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

Cheng
08-29-2007, 09:05 AM
Script: Switch Menu
http://www.dynamicdrive.com/dynamicindex1/switchmenu.htm

Hi John.

I'm sorry about the credit to Dynamic Drive missing in the JS file.
This was without any intention and I can't recall why it wasn't in there.
Usualy I copy the whole code including the credits and create an external JS file from it.
Anyway, this won't happen again.
Please give me a hand on how to convert the links that contain only one link in the submenu to a straight link in the same style as the others that would be real nice.

Thanks in advance and sorry about the missing credits,
Cheng

dcstow
08-30-2007, 01:33 AM
I'm trying to configure this Switch Menu from the libary and I want that the submenus that contain only one link in it don't open up a submenu and just work as a straight link.

If I am understanding your question correctly, this (http://www.dynamicdrive.com/forums/showthread.php?t=8048) thread should help you out.

http://www.dynamicdrive.com/forums/showthread.php?t=8048

Cheng
08-30-2007, 05:04 AM
......thanks for the link to this thread but I'm still stuck.
Now I managed that one of the links don't open a submenu but I still can't make it a straight link which stays in the same style as the links that opens up a submenu.


<div class="menutitle" onclick="SwitchMenu()">Menu3</div>
<p><span class="submenu" id="sub"><br />
</span></p>

What I need is that "Menu3" works as link but without underline or color change on hoover.
This link should look like all the others.
Is this possible?

Cheng
08-30-2007, 01:04 PM
,,,,,,,in the attached Zip file you can see that I'm pretty close.
Everything seems to be ok except for the link properties.
Please someone tell me how I can get rid of the underline and the link color?
And is it possible that if someone clicks on Menu3 that another open submenu is closed automaticially.........

dcstow
08-31-2007, 06:43 AM
Everything seems to be ok except for the link properties.
Please someone tell me how I can get rid of the underline and the link color?

Add this to your CSS file:


.submenu a{
color:#000000;
text-decoration: none;
}

Cheng
08-31-2007, 08:52 AM
.......ok thanks I'll try it out and post back later if it worked out.
Thanks again very much.......Cheng.......