Results 1 to 3 of 3

Thread: Urban Gray Accordion Menu with fetched content

  1. #1
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Urban Gray Accordion Menu with fetched content

    hi


    im trying to use the Accordion Menu Urban Gray Accordion Menu
    http://www.dynamicdrive.com/dynamici...menu-urban.htm

    only problem is im fetching the contents of it via java script from my right menu
    fore some reason i cant get it to work

    here is my page
    244473.showenter.com/


    this is my java script code


    Code:
    <script>
    
        window.onload = function () {
            var itemsdiv = document.getElementById("MenuBar1").getElementsByTagName("div");
            var itemsul = document.getElementById("MenuBar1").getElementsByTagName("ul");
            var itemsa = document.getElementById("MenuBar1").getElementsByTagName("a");
            var itemli = document.getElementById("MenuBar1").getElementsByTagName("li");
    
    
            for (var i = 0; i < itemsdiv.length; i++) 
                document.getElementById("MenuBar1").getElementsByTagName("div").className = itemsdiv[i].className = "headerbar";
    
            for (var i = 0; i < itemsul.length; i++)
            document.getElementById("MenuBar1").getElementsByTagName("ul").className = itemsul[i].className = "submenu";
            
            for (var i = 0; i < itemsa.length; i++)
                document.getElementById("MenuBar1").getElementsByTagName("a").className = itemsa[i].className = "";
    
            for (var i = 0; i < itemsa.length; i++)
                document.getElementById("MenuBar1").getElementsByTagName("a").tabIndex = itemsa[i].tabIndex = "";
    
            for (var i = 0; i < itemli.length; i++)
                document.getElementById("MenuBar1").getElementsByTagName("a").id = itemli[i].id = ""; 
    
    
    
            var list = document.getElementById("MenuBar1");
            var items = list.getElementsByTagName("ul");
            for (var i = 0, size = items.length; i < size; i++) {
                document.getElementById("lior").innerHTML += items[i].parentNode.innerHTML;
            }
        }</script>
    
        <div id="lior" class="urbangreymenu"></div>
    could anyone help me figuring out whats wrong

  2. #2
    Join Date
    Aug 2004
    Posts
    9,893
    Thanks
    3
    Thanked 966 Times in 954 Posts
    Blog Entries
    15

    Default

    The validity of your right menu structure wise aside, the main issue with the approach you're using to pull the menu's contents into the Accordion Menu is that you're using window.onload to do this. The Accordion menu is initialized before the window loads, so by the time the contents is pulled in, it's too late already. Regardless, a much cleaner approach is just to put the contents of your right menu in an external file (ie: menu.htm), and dynamically include it for both the right menu and Accordion Menu contents on the page. Is your page SSI enabled?
    DD Admin

  3. #3
    Join Date
    Feb 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    im aware that its not the best way to do this, unfortunately i don't have any other option.
    is there any other way i can postpone the initialztion of the The Accordion menu

Similar Threads

  1. Resolved Urban Gray Accordion Menu - RESOLVED
    By Mejse78 in forum Dynamic Drive scripts help
    Replies: 1
    Last Post: 05-26-2012, 06:13 PM
  2. Urban Gray Accordion Menu not working
    By garabitas in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-08-2010, 10:25 PM
  3. Help with Urban Gray Accordion Menu Please
    By Cyberdog in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 05-24-2009, 09:11 PM
  4. Urban Gray Accordion Menu Help needed
    By annelies in forum Dynamic Drive scripts help
    Replies: 4
    Last Post: 10-07-2008, 12:13 AM

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
  •