Cascading menu question

A

Angus

I have had a look at

http://javascript.internet.com/navigation/cascade-menu.html

Which is roughly what I want to do.

Roughly the menu looks like this:

Menu #1 Menu #2 Menu #3 Menu #4

When I click on the top level menu you see a drop down menu. That's fine.

However, Menu 1 I don't want it to drop down - eg could be the Home link -
so user clicks and it just goes straight to Home page. Any ideas how I
would edit to do that?

Angus
 
D

David Mark


So have I.


function InitMenu()
{
var bar = menuBar.children

First line and they already blew it. This is a proprietary IE
property.

for(var i=0;i < bar.length;i++)
{
var menu=eval(bar.menu)

Evil use of eval.

menu.style.visibility = "hidden"
bar.onmouseover = new Function("ShowMenu("+bar.id+")")

Evil use of aliased eval.

[snip more of the same]

menu.style.pixelTop = obj.getBoundingClientRect().top +
obj.offsetHeight + Bdy.scrollTop

More IE-only nonsense.

[snip]

window.defaultStatus = obj.title

What?!

ShowSubMenu(obj)
}

function Do(obj)
{
var cmd = eval(obj).cmd
window.navigate(cmd)

This is perhaps the worst script ever written.

[snip]

///////////////////CascadedDropdown Menu/////////////////
//Date : 08/09/2001

Even then it was thoroughly incompetent.
//
//Version : 1.0 //
//Author Mr.Arun N Kumar //
//EMail: (e-mail address removed) //
/////////////////////////////////////////////////////////
// Modifications on this code is not recomended

(!)

// Suggestions are welcome

Find another hobby.
Which is roughly what I want to do.

It is not what you want to do at all.
Roughly the menu looks like this:

Menu #1  Menu #2  Menu #3  Menu #4

When I click on the top level menu you see a drop down menu.  That's fine.

However, Menu 1 I don't want it to drop down - eg could be the Home link -
so user clicks and it just goes straight to Home page.  Any ideas how I
would edit to do that?

You would edit the markup accordingly. Any competent menu script
should leave the item alone if it has no children.

Try this one:

http://code.google.com/p/nicemenus/
 
A

Angus


So have I.


function InitMenu()
{
var bar = menuBar.children

First line and they already blew it. This is a proprietary IE
property.

for(var i=0;i < bar.length;i++)
{
var menu=eval(bar.menu)

Evil use of eval.

menu.style.visibility = "hidden"
bar.onmouseover = new Function("ShowMenu("+bar.id+")")

Evil use of aliased eval.

[snip more of the same]

menu.style.pixelTop = obj.getBoundingClientRect().top +
obj.offsetHeight + Bdy.scrollTop

More IE-only nonsense.

[snip]

window.defaultStatus = obj.title

What?!

ShowSubMenu(obj)
}

function Do(obj)
{
var cmd = eval(obj).cmd
window.navigate(cmd)

This is perhaps the worst script ever written.

[snip]

///////////////////CascadedDropdown Menu/////////////////
//Date : 08/09/2001

Even then it was thoroughly incompetent.
//
//Version : 1.0 //
//Author Mr.Arun N Kumar //
//EMail: (e-mail address removed) //
/////////////////////////////////////////////////////////
// Modifications on this code is not recomended

(!)

// Suggestions are welcome

Find another hobby.
Which is roughly what I want to do.

It is not what you want to do at all.
Roughly the menu looks like this:

Menu #1 Menu #2 Menu #3 Menu #4

When I click on the top level menu you see a drop down menu. That's fine.

However, Menu 1 I don't want it to drop down - eg could be the Home link -
so user clicks and it just goes straight to Home page. Any ideas how I
would edit to do that?

You would edit the markup accordingly. Any competent menu script
should leave the item alone if it has no children.

Try this one:

http://code.google.com/p/nicemenus/

I only tested on IE - yes can confirm it doesn't work on Firefox. I will
have to see if I can make code more generic.
 
V

VK

I have had a look at

http://javascript.internet.com/navigation/cascade-menu.html

Which is roughly what I want to do.

Roughly the menu looks like this:

Menu #1 Menu #2 Menu #3 Menu #4

When I click on the top level menu you see a drop down menu. That's fine.

However, Menu 1 I don't want it to drop down - eg could be the Home link -
so user clicks and it just goes straight to Home page. Any ideas how I
would edit to do that?

The most obvious was already suggested: simply add a necessary styled
- so no looking different - menu item containing regular <a> element.

Also Dynamicdrive has a large collection of different popup menus,
http://www.dynamicdrive.com/dynamicindex1/index.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top