Results 1 to 7 of 7

Thread: DD Menu always reverting back to ID

  1. #1
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question DD Menu always reverting back to ID

    1) Script: DD Tab Menu
    2) http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm

    Hi all, I hope someone can help with this issue…

    I just been asked to modify a website which uses the DD Tab Menu script, and there is an issue with the navigation menu not working in IE7/8. It runs fine in Firefox, Chrome & Safari.

    I have checked the output of the HTML code and <?php echo $menu_id; ?> is being returned, so I am stumped as to why it always displays menu_id = 0 when a new page is loaded in IE 7/8.

    http://www.paxtonhouse.co.uk is the live site.

    I have posted the php code used to obtain the current menu id which is in the header below. Any ideas anyone?

    Thanks in advance.

    Code:
    <?php
    $menu_id = 0;
    $menu = array('paxton-house' => 0, 'planning-your-visit' => 1, 'things-to-see-and-do' => 2, 'whatson' => 3, 'weddings-and-functions' => 4, 'learning-at-paxton' => 5, 'contact' => 6);
    if ( isset($menu[$sf_request->getParameter('module')]) )
    {
    	$menu_id = $menu[$sf_request->getParameter('module')];
    }
    ?>
    
    <script type="text/javascript">
    <!--
    //<![CDATA[
    // Tab Menu
    ddtabmenu.definemenu("menu", <?php echo $menu_id; ?>);
    //]]> -->
    </script>

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hmm since you're using PHP to output the initialization code, that output will be the same regardless of which browser you're using. In other words, in FF for example, I see the same thing as in IE when I view source on your page:
    Code:
    ddtabmenu.definemenu("menu", 0);
    As far as why 0 is getting output, this is strictly an issue with your logic inside the PHP code. There isn't enough info just based on the above to say what that is.
    DD Admin

  3. #3
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks for looking into this, I appreciate your time.

    I am still perplexed as to why this would be happening, as you rightly say the code being output is providing the correct menu ID in all browsers.

    In IE though, when you click on a menu item, eg What's On?, the submenu displays temporarily, then as soon as the "What's On?" page loads, the menu/submenu reverts back to the first menu with ID = 0.

    If anyone else has any ideas why this may be happening, I'd really appreciate it.

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Does the issue still occur in IE if you revert your current modified version of ddtabmenu.js to the original one?
    DD Admin

  5. #5
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I'll give that a try and report back. Thanks for the tip.

    UPDATE:

    I just tried the original ddtabmenu.js script as you suggested. The submenu now appears on hovering over the top level (which it didn't before and at least allows the selection of submenu items), but the submenu still reverts back to the first menu with ID = 0 when a new page is loaded.

    Getting closer!
    Last edited by Galalad; 12-15-2010 at 07:02 PM. Reason: Tried suggestion and reporting back

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Testing your page offline in IE, it seems if I temporarily remove the other scripts on your page, the expected sub menu gets correctly shown. In other words, I removed the following lines in gray from your page:

    Code:
    <script type="text/javascript" src="/js/jquery.js"></script>
    
    <script type="text/javascript" src="/js/jquery.cycle.js"></script>
    <script type="text/javascript" src="/js/jquery.replace.js"></script>
    <script type="text/javascript" src="/js/jquery.pngfix.js"></script>
    <script type="text/javascript" src="/js/jquery.fancybox.js"></script>
    <script type="text/javascript" src="/js/tabmenu.js"></script>
    <script type="text/javascript" src="/js/content.js"></script>
    Can you give that a try?
    DD Admin

  7. The Following User Says Thank You to ddadmin For This Useful Post:

    Galalad (12-20-2010)

  8. #7
    Join Date
    Dec 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Superb, thanks for pointing me in the right direction, there was a reference to
    Code:
    if ( !ddtabmenu["menu-menuitems"] )
    {
    	ddtabmenu.definemenu("menu", 0)
    }
    in the content.js file which was causing the issue.

    Many thanks for helping in this matter. I knew we'd get there in the end.
    Craig

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
  •