javascript menus and speed

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Christopher Boyce

    javascript menus and speed

    I am using the fw_menu.js from John Ahlquist (October 2000). The menu
    works great, but the problem I am having is with it's speed in IE6.

    The problem is I am making a menu for each item in a list (160 items).
    It takes around 17 seconds to display the page with this javascript.
    If I pull it out the page opens in about a second.

    I would like to be able to use one Menu Object and each time I click
    on an item, have it reset the Menu Object and call the addMenuItem
    Method for whatever I want to pass in.

    I have tried to add a Method to fw_menu.js, by setting:

    function resetMenuList() {
    this.item = new Array();
    this.actions = new Array();
    }

    This does not seem to work.

    See below for my menu list, this would have 160 menus, but I only put
    the first two in.

    Thanks for any help,

    Chris



    <snip>
    function loadMenus() {
    window.myMenu2 = new Menu("myMenu2", 120, 18, "Verdanda", 11,
    "#000000", "#000000", "#CCCCCC", "#CCCCCC");
    myMenu2.addMenu Item("View");
    myMenu2.addMenu Separator();
    myMenu2.addMenu Item("Modify");
    myMenu2.addMenu Item("Propertie s");
    myMenu2.addMenu Item("Delete");
    myMenu2.addMenu Item("Purge");
    myMenu2.hideOnM ouseOut=true;

    window.myMenu3 = new Menu("myMenu3", 120, 18, "Verdanda", 11,
    "#000000", "#000000", "#CCCCCC", "#CCCCCC");
    myMenu3.addMenu Item("View");
    myMenu3.hideOnM ouseOut=true;

    ... to n
    </snip>
  • William Morris

    #2
    Re: javascript menus and speed

    We have similar problems, and the root of the problem is the sheer quantity
    of items. Is there any way to pare that down?

    "Christophe r Boyce" <cboyce45@yahoo .com> wrote in message
    news:c67657ff.0 404211844.5e64d 0e2@posting.goo gle.com...[color=blue]
    > I am using the fw_menu.js from John Ahlquist (October 2000). The menu
    > works great, but the problem I am having is with it's speed in IE6.
    >
    > The problem is I am making a menu for each item in a list (160 items).
    > It takes around 17 seconds to display the page with this javascript.
    > If I pull it out the page opens in about a second.
    >
    > I would like to be able to use one Menu Object and each time I click
    > on an item, have it reset the Menu Object and call the addMenuItem
    > Method for whatever I want to pass in.
    >
    > I have tried to add a Method to fw_menu.js, by setting:
    >
    > function resetMenuList() {
    > this.item = new Array();
    > this.actions = new Array();
    > }
    >
    > This does not seem to work.
    >
    > See below for my menu list, this would have 160 menus, but I only put
    > the first two in.
    >
    > Thanks for any help,
    >
    > Chris
    >
    >
    >
    > <snip>
    > function loadMenus() {
    > window.myMenu2 = new Menu("myMenu2", 120, 18, "Verdanda", 11,
    > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
    > myMenu2.addMenu Item("View");
    > myMenu2.addMenu Separator();
    > myMenu2.addMenu Item("Modify");
    > myMenu2.addMenu Item("Propertie s");
    > myMenu2.addMenu Item("Delete");
    > myMenu2.addMenu Item("Purge");
    > myMenu2.hideOnM ouseOut=true;
    >
    > window.myMenu3 = new Menu("myMenu3", 120, 18, "Verdanda", 11,
    > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
    > myMenu3.addMenu Item("View");
    > myMenu3.hideOnM ouseOut=true;
    >
    > ... to n
    > </snip>[/color]


    Comment

    • Christopher Boyce

      #3
      Re: javascript menus and speed

      I really can't limit the list. In fact it could get bigger.

      Thanks,

      Chris

      "William Morris" <news.remove.th is.and.the.dots @seamlyne.com> wrote in message news:<c68fn9$8r 26j$1@ID-205671.news.uni-berlin.de>...[color=blue]
      > We have similar problems, and the root of the problem is the sheer quantity
      > of items. Is there any way to pare that down?
      >
      > "Christophe r Boyce" <cboyce45@yahoo .com> wrote in message
      > news:c67657ff.0 404211844.5e64d 0e2@posting.goo gle.com...[color=green]
      > > I am using the fw_menu.js from John Ahlquist (October 2000). The menu
      > > works great, but the problem I am having is with it's speed in IE6.
      > >
      > > The problem is I am making a menu for each item in a list (160 items).
      > > It takes around 17 seconds to display the page with this javascript.
      > > If I pull it out the page opens in about a second.
      > >
      > > I would like to be able to use one Menu Object and each time I click
      > > on an item, have it reset the Menu Object and call the addMenuItem
      > > Method for whatever I want to pass in.
      > >
      > > I have tried to add a Method to fw_menu.js, by setting:
      > >
      > > function resetMenuList() {
      > > this.item = new Array();
      > > this.actions = new Array();
      > > }
      > >
      > > This does not seem to work.
      > >
      > > See below for my menu list, this would have 160 menus, but I only put
      > > the first two in.
      > >
      > > Thanks for any help,
      > >
      > > Chris
      > >
      > >
      > >
      > > <snip>
      > > function loadMenus() {
      > > window.myMenu2 = new Menu("myMenu2", 120, 18, "Verdanda", 11,
      > > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
      > > myMenu2.addMenu Item("View");
      > > myMenu2.addMenu Separator();
      > > myMenu2.addMenu Item("Modify");
      > > myMenu2.addMenu Item("Propertie s");
      > > myMenu2.addMenu Item("Delete");
      > > myMenu2.addMenu Item("Purge");
      > > myMenu2.hideOnM ouseOut=true;
      > >
      > > window.myMenu3 = new Menu("myMenu3", 120, 18, "Verdanda", 11,
      > > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
      > > myMenu3.addMenu Item("View");
      > > myMenu3.hideOnM ouseOut=true;
      > >
      > > ... to n
      > > </snip>[/color][/color]

      Comment

      • mscir

        #4
        Re: javascript menus and speed

        Christopher Boyce wrote:[color=blue]
        > I am using the fw_menu.js from John Ahlquist (October 2000). The menu
        > works great, but the problem I am having is with it's speed in IE6.
        >
        > The problem is I am making a menu for each item in a list (160 items).
        > It takes around 17 seconds to display the page with this javascript.
        > If I pull it out the page opens in about a second.
        >
        > I would like to be able to use one Menu Object and each time I click
        > on an item, have it reset the Menu Object and call the addMenuItem
        > Method for whatever I want to pass in.
        >
        > I have tried to add a Method to fw_menu.js, by setting:
        >
        > function resetMenuList() {
        > this.item = new Array();
        > this.actions = new Array();
        > }
        >
        > This does not seem to work.
        >
        > See below for my menu list, this would have 160 menus, but I only put
        > the first two in.
        >
        > Thanks for any help,
        >
        > Chris
        >
        >
        >
        > <snip>
        > function loadMenus() {
        > window.myMenu2 = new Menu("myMenu2", 120, 18, "Verdanda", 11,
        > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
        > myMenu2.addMenu Item("View");
        > myMenu2.addMenu Separator();
        > myMenu2.addMenu Item("Modify");
        > myMenu2.addMenu Item("Propertie s");
        > myMenu2.addMenu Item("Delete");
        > myMenu2.addMenu Item("Purge");
        > myMenu2.hideOnM ouseOut=true;
        >
        > window.myMenu3 = new Menu("myMenu3", 120, 18, "Verdanda", 11,
        > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
        > myMenu3.addMenu Item("View");
        > myMenu3.hideOnM ouseOut=true;
        >
        > ... to n
        > </snip>[/color]

        Can your menu be viewed on the web, url?
        Mike

        Comment

        • Christopher Boyce

          #5
          Re: javascript menus and speed

          You can see it here: http://www.christopherleeboyce.com/test/test.html

          Chris

          mscir <mscir@access4l ess.com.net.org .uk> wrote in message news:<108h63go5 t5313a@corp.sup ernews.com>...[color=blue]
          > Christopher Boyce wrote:[color=green]
          > > I am using the fw_menu.js from John Ahlquist (October 2000). The menu
          > > works great, but the problem I am having is with it's speed in IE6.
          > >
          > > The problem is I am making a menu for each item in a list (160 items).
          > > It takes around 17 seconds to display the page with this javascript.
          > > If I pull it out the page opens in about a second.
          > >
          > > I would like to be able to use one Menu Object and each time I click
          > > on an item, have it reset the Menu Object and call the addMenuItem
          > > Method for whatever I want to pass in.
          > >
          > > I have tried to add a Method to fw_menu.js, by setting:
          > >
          > > function resetMenuList() {
          > > this.item = new Array();
          > > this.actions = new Array();
          > > }
          > >
          > > This does not seem to work.
          > >
          > > See below for my menu list, this would have 160 menus, but I only put
          > > the first two in.
          > >
          > > Thanks for any help,
          > >
          > > Chris
          > >
          > >
          > >
          > > <snip>
          > > function loadMenus() {
          > > window.myMenu2 = new Menu("myMenu2", 120, 18, "Verdanda", 11,
          > > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
          > > myMenu2.addMenu Item("View");
          > > myMenu2.addMenu Separator();
          > > myMenu2.addMenu Item("Modify");
          > > myMenu2.addMenu Item("Propertie s");
          > > myMenu2.addMenu Item("Delete");
          > > myMenu2.addMenu Item("Purge");
          > > myMenu2.hideOnM ouseOut=true;
          > >
          > > window.myMenu3 = new Menu("myMenu3", 120, 18, "Verdanda", 11,
          > > "#000000", "#000000", "#CCCCCC", "#CCCCCC");
          > > myMenu3.addMenu Item("View");
          > > myMenu3.hideOnM ouseOut=true;
          > >
          > > ... to n
          > > </snip>[/color]
          >
          > Can your menu be viewed on the web, url?
          > Mike[/color]

          Comment

          • mscir

            #6
            Re: javascript menus and speed

            Christopher Boyce wrote:
            [color=blue]
            > You can see it here: http://www.christopherleeboyce.com/test/test.html
            >
            > Chris[/color]

            Since you're using an identical menu for every table anchor, I'd make a
            single menu using divs (and css for special effects).

            When an anchor in a table cell is clicked, move the menu to the table
            row that was clicked and then make it visible, positioned over the
            clicked anchor so the mouse is already over the menu, then you can hide
            the menu if the mouse moves over the table (off of the menu divs).

            So instead of 106 identical menus you use one single menu, and a global
            var that is set on each row's anchor click (to the row number).

            Document/Web Page/etc. names can be stored in an array with element
            numbers matching the table row numbers, so generic view, properties,
            delete, purge etc. functions can work using the array element number
            stored in the global var.

            I sent you an example that includes this menu approach with your table.
            The page loads in 1 second or less (requires no external .js or .css
            files, no menu rendering, and is significantly smaller than the original
            approach).

            Good Luck,
            Mike

            Comment

            Working...