/    Sign up×
Community /Pin to ProfileBookmark

unique javascript menu help needed

Hi guys,

I’m trying to make a horizontal javascript menu which drops down into a horizontal sub menu, and drops vertically as a SUB-submenu.

Its something like this:

Home about |products| support
|A Series|B Series|C Series|
|Overview|
|Prices |
|Order |

can anyone help me?
thanks very much

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@HaganeNoKokoroOct 17.2004 — Here's a CSS list-based approach. Works for me in NN7, FF1.0PR, and IE6.

[upl-file uuid=87be508a-6f97-441a-b4a0-ba8e05d9ee22 size=1kB]menu.zip[/upl-file]
Copy linkTweet thisAlerts:
@postinoauthorOct 17.2004 — Wow, thanks for the prompt reply. I've never used CSS before though, but I like what I see. I'm trying to modify the series button to drop down from under the menu button instead of beside the menu button. Can you tell me how to do that?

And I can't find the code to set the width & height & font.

Thanks once again for the prompt reply.
Copy linkTweet thisAlerts:
@HaganeNoKokoroOct 17.2004 — Font: add the red partul.base {
[COLOR=RED]font-size:16pt;
font-family:YourFontHere;[/COLOR]
list-style:none;
display:block;
margin:0px;
padding:0px;
}
Displaying underneath: add the red partsul.base li:hover ul.menu, ul.base li.hover ul.menu {
[COLOR=RED]position:absolute;[/COLOR]
display:inline;
}
<ul class="base">
<li><a href="#">Menu</a>[COLOR=RED]<br>[/COLOR]
<ul class="menu">
<li class="l1"><a href="#"> Series A </a>
<ul class="sub1">
<li><a href="#">Overview</a></li>
<li><a href="#">Prices</a></li>
<li><a href="#">Order</a></li>
</ul>
</li>

<i> </i> &lt;li class="l1"&gt;&lt;a href="#"&gt;&amp;nbsp;Series B&amp;nbsp;&lt;/a&gt;
<i> </i> &lt;ul class="sub1"&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Overview&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Prices&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Order&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;/ul&gt;
<i> </i> &lt;/li&gt;

<i> </i> &lt;li class="l1"&gt;&lt;a href="#"&gt;&amp;nbsp;Series C&amp;nbsp;&lt;/a&gt;
<i> </i> &lt;ul class="sub1"&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Overview&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Prices&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;li&gt;&lt;a href="#"&gt;Order&lt;/a&gt;&lt;/li&gt;
<i> </i> &lt;/ul&gt;
<i> </i> &lt;/li&gt;
<i> </i>&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
Menu Width: change the red numberul.menu li:hover ul.sub1, ul.menu li.l1hover ul.sub1 {
display:inline;
position:absolute;
width:[COLOR=RED]100[/COLOR]px;
top:19px;
border:solid #000000 1px;
}
You could set a height for the menu items as well, but I don't recommend it since it would mess with their normal resizing.

Also, you should note I'm relatively new to doing this sort of thing with CSS; doubtless others who are better will point out big flaws in my approach. I welcome constructive criticism.
×

Success!

Help @postino spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...