473,505 Members | 14,394 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading Menu scripts

I am looking for a simple cascading menu javascript.One where it lives on
the left side of the screen, listed vertically and when you select a menu
item the list expands to show the sub menu items within that catagory.

This is the only decent one I've been able to find.
http://www.bravenet.com/resources/sc...d=92&cat_name=

If you check out the demo you'll notice it's very slow. It has a speed
variable but it only seems to make it slower.

Another example of close to what I'm trying to accomplish (my first
inspiration):
http://www.ataonline.com/about/media/index.asp

If anyone knows how to speed up the first one, or knows of another SIMPLE
expanding cascading script please let me know. I'm trying to make this as
cross browser as possible as well. I know it's a lot to ask on a no budget
project, but thought I'd ask anyways.

Thanks,

Steven LaPha Jr.
Jul 20 '05 #1
2 1503
"gregory stevenson" <gr********@hotmail.com> writes:
This is the only decent one I've been able to find.
http://www.bravenet.com/resources/sc...d=92&cat_name=
I would be worried using it. I can see a few bad methods used, e.g.,
setting the obj.style.top without a unit, which *will* fail in most
browsers in standards mode.
If you check out the demo you'll notice it's very slow. It has a speed
variable but it only seems to make it slower.
Yes
If anyone knows how to speed up the first one, or knows of another SIMPLE
expanding cascading script please let me know.


The speed is used as the second argument of the setTimeout, and
defaults to 0, so that's as fast as it gets.

What you can do, is to change by how many pixles it moves per timeout.
I.e., the line
obj.style.top = parseInt(obj.style.top)-1;
can be changed to
obj.style.top = Math.max(parseInt(obj.style.top,10)-5,0) + "px";
A line furter down reads
nowv--;
Change that to
nowv-=5;
and it moves five times as fast when it closes. There is probably an equivalent
code for moving down.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Ok here's what I got,
Only problem is now the menu boxes overlap when compressed, and have an
extra space when expanded. Not too big of a problem, but probably solvable.
It IS faster though, much more managable.
Now that many have high speed networks, and faster computers who wants to
wait for a slow menu that acts as if it's on a 486?

------------------------clipped script------------------------
function epull_down(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip =
"rect(0,"+width+","+(+nowv+1)+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top =Math.max(parseInt(obj.style.top,10)+5,0)+"px";
}
nowv+=5;
if(nowv < to) timerID =
setTimeout("epull_down("+nr+","+to+","+nowv+")",sp eed);
else timerID = "";
}

function epull_up(nr,to,nowv)
{
name = "down" + (nr-1);
obj = document.getElementById(name).style.clip =
"rect(0,"+width+","+nowv+",0)";
for (i=nr;i<self_menu.length;i++)
{
name = "down" + i;
obj = document.getElementById(name);
obj.style.top = Math.max(parseInt(obj.style.top,10)-5,0)+"px";
}
nowv-=5;
if(nowv > to) timerID =
setTimeout("epull_up("+nr+","+to+","+nowv+")",spee d);
else timerID = "";
-------------------------end cliped script---------------

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:8y**********@hotpop.com...
"gregory stevenson" <gr********@hotmail.com> writes:
This is the only decent one I've been able to find.
http://www.bravenet.com/resources/sc...d=92&cat_name=

I would be worried using it. I can see a few bad methods used, e.g.,
setting the obj.style.top without a unit, which *will* fail in most
browsers in standards mode.
If you check out the demo you'll notice it's very slow. It has a speed
variable but it only seems to make it slower.
Yes
If anyone knows how to speed up the first one, or knows of another

SIMPLE expanding cascading script please let me know.


The speed is used as the second argument of the setTimeout, and
defaults to 0, so that's as fast as it gets.

What you can do, is to change by how many pixles it moves per timeout.
I.e., the line
obj.style.top = parseInt(obj.style.top)-1;
can be changed to
obj.style.top = Math.max(parseInt(obj.style.top,10)-5,0) + "px";
A line furter down reads
nowv--;
Change that to
nowv-=5;
and it moves five times as fast when it closes. There is probably an

equivalent code for moving down.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html> 'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1775
by: Humpty Dumpty | last post by:
Hi folks, here's a challenge: I have a dynamically created cascading menu in Tkinter that can be quite large because it is created from a file. I tried using lazy creation so only the menu item...
3
3567
by: michelle | last post by:
Hi all, I am new to Tk, or Python GUI programming and I seem to be stuck. I have looked about for help with Tk GUIs, but everything seems so terse or incomplete?? I have been mostly using the...
7
2705
by: Marci | last post by:
I found this script for cascading menus, however, I cannot reach the author to solve the bug I am having when I add a second menu to it. My problem is this: If I click on the first link, the...
1
1200
by: Cindy Lee | last post by:
is it possible to have cascading menus like: http://www.cracky.net/JAVA/Navigation/cascading-menu.html With scrollbars added, so you can only see a few options at a time? On some of my options...
1
1999
by: JMosey | last post by:
Not sure if this has been covered ( a google search came up pretty bare). I have a site that: - has multi-level cascading menus - floats center of the browser window - Will have fairly heavy...
1
1370
by: arjun.zacharia | last post by:
Hi everyone, i want to implement a cascading menu in my application but do not want to reinvent the wheel. is there anybody here who might have written such stuff or could help me with somem...
1
1638
by: dkirkdrei | last post by:
I am using the javascript below in conjuction with PHP to dynamically build a cascading menu of part assemblies from a database. The cascading menu allows the user to "drill" down to the single...
1
2145
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5613
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5028
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.