Cascading Menu scripts

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gregory stevenson

    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.
    Cheap hosting and free web tools. Build your website with our easy webpage builder, web tools, web services, and free website content.


    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):


    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.


  • Lasse Reichstein Nielsen

    #2
    Re: Cascading Menu scripts

    "gregory stevenson" <gregsteven@hot mail.com> writes:
    [color=blue]
    > This is the only decent one I've been able to find.
    > http://www.bravenet.com/resources/sc...d=92&cat_name=[/color]

    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.
    [color=blue]
    > 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.[/color]

    Yes
    [color=blue]
    > If anyone knows how to speed up the first one, or knows of another SIMPLE
    > expanding cascading script please let me know.[/color]

    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.st yle.top)-1;
    can be changed to
    obj.style.top = Math.max(parseI nt(obj.style.to p,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 - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • gregory stevenson

      #3
      Re: Cascading Menu scripts

      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,t o,nowv)
      {
      name = "down" + (nr-1);
      obj = document.getEle mentById(name). style.clip =
      "rect(0,"+width +","+(+nowv+1)+ ",0)";
      for (i=nr;i<self_me nu.length;i++)
      {
      name = "down" + i;
      obj = document.getEle mentById(name);
      obj.style.top =Math.max(parse Int(obj.style.t op,10)+5,0)+"px ";
      }
      nowv+=5;
      if(nowv < to) timerID =
      setTimeout("epu ll_down("+nr+", "+to+","+nowv+" )",speed);
      else timerID = "";
      }

      function epull_up(nr,to, nowv)
      {
      name = "down" + (nr-1);
      obj = document.getEle mentById(name). style.clip =
      "rect(0,"+width +","+nowv+",0)" ;
      for (i=nr;i<self_me nu.length;i++)
      {
      name = "down" + i;
      obj = document.getEle mentById(name);
      obj.style.top = Math.max(parseI nt(obj.style.to p,10)-5,0)+"px";
      }
      nowv-=5;
      if(nowv > to) timerID =
      setTimeout("epu ll_up("+nr+","+ to+","+nowv+")" ,speed);
      else timerID = "";


      -------------------------end cliped script---------------

      "Lasse Reichstein Nielsen" <lrn@hotpop.com > wrote in message
      news:8yjxeixm.f sf@hotpop.com.. .[color=blue]
      > "gregory stevenson" <gregsteven@hot mail.com> writes:
      >[color=green]
      > > This is the only decent one I've been able to find.
      > >[/color][/color]
      http://www.bravenet.com/resources/sc...d=92&cat_name=[color=blue]
      >
      > 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.
      >[color=green]
      > > 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.[/color]
      >
      > Yes
      >[color=green]
      > > If anyone knows how to speed up the first one, or knows of another[/color][/color]
      SIMPLE[color=blue][color=green]
      > > expanding cascading script please let me know.[/color]
      >
      > 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.st yle.top)-1;
      > can be changed to
      > obj.style.top = Math.max(parseI nt(obj.style.to p,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[/color]
      equivalent[color=blue]
      > code for moving down.
      >
      > /L
      > --
      > Lasse Reichstein Nielsen - lrn@hotpop.com
      > DHTML Death Colors:[/color]
      <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>[color=blue]
      > 'Faith without judgement merely degrades the spirit divine.'
      >[/color]


      Comment

      Working...