Results 1 to 4 of 4

Thread: how to initialize multiple instances on one page?

  1. #1
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy how to initialize multiple instances on one page?

    Hello,



    Using Script Title: ddsmoothmenu

    Script URL (on DD): http://www.dynamicdrive.com/dynamici...smoothmenu.htm

    3) Trying to use three vertical menus on the same page and receive the following error:
    'parent().get(...)' is null or not an object

    My page with the error:
    http://aprilbarrett.com/test/personal/savings/cod.asp

    The javascript page:
    http://aprilbarrett.com/test/scripts/ddsmoothmenu.js

    I think I figured out that it doesn't like that I call multiple menu instances on a single page.

    Any way to combine the following?

    Code:
    ddsmoothmenu.init({
        mainmenuid: "persMenu", //Menu DIV id
        orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
        classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
        contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
        mainmenuid: "busMenu", //Menu DIV id
        orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
        classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
        contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    
    ddsmoothmenu.init({
        mainmenuid: "onlinesMenu", //Menu DIV id
        orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
        classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
        contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
    })
    Last edited by jscheuer1; 05-14-2010 at 03:47 AM. Reason: fix broken link

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You actually have 4 calls, not just the three shown in your post. That's not the problem (the demo page has three menus and there is virtually no limit on the number of these menus you may have on one page). I haven't narrowed it down, but it looks like an issue with the markup (though it could possibly be something else). The script is looking for something that's not there, which probably means you've deviated from the markup template in some way.

    The menus do work though, so you haven't done anything major, and I know it can be hard sometimes to know what modifications are OK, and which may cause an error.

    Off hand, can you think of anything in your markup that deviates from the proscribed template offered on the demo page? Perhaps some added feature or look you threw in?
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    May 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks.

    I figured out what I did wrong. The init settings did not correspond to my div tags correctly. It was a dumb thing to do - but at least the issue wasn't major.

  4. #4
    Join Date
    Aug 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    may i know how u fix this? im having the same problem yet still cannot find any solution.

    thanks mate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •