Results 1 to 6 of 6

Thread: IE7 hack for javascript menu

  1. #1
    Join Date
    May 2011
    Location
    SFBA, CA, USA
    Posts
    94
    Thanks
    6
    Thanked 7 Times in 7 Posts

    Default IE7 hack for javascript menu

    The main menu tabs on this website don't show up in IE7. Can someone help me find a hack for this?

    http://www.heritagechurch.us/Sandbox

    Thanks,
    dbc

  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

    Only for future reference:

    Please post about Dynamic Drive Scripts in the Dynamic Drive Scripts Help section here where I've moved this thread, and:

    Warning: Please include a link to the DD script(s) in question in your post. See this post for more information.


    For current reference:

    Your page is in violation of Dynamic Drive's usage terms, which, among other things, state that the script credit must appear in the source code of the page(s) using the script. Please reinstate the notice first.


    That all said, works fine on the demo page:

    http://www.dynamicdrive.com/dynamicindex1/tabmenu.htm

    On the page you linked to it's something about the markup (possibly menu header tabs without subItem content) and IE 7 that has IE 7 at times calculating a negative value for leftPos here:

    Code:
    				var leftPos = mainMenuLinks[subCounter-1].offsetLeft;
    				document.getElementById('submenu_'+subCounter).style.paddingLeft =  leftPos + 'px';
    				subItem.style.position ='absolute';
    				if(subItem.offsetWidth > parentWidth){
    					leftPos = leftPos - Math.max(0,subItem.offsetWidth-parentWidth);
    				}
    				subItem.style.paddingLeft =  leftPos + 'px';
    				subItem.style.position ='static';
    such that when you get to the highlighted line, IE 7 throws an error. Replace that line with:

    Code:
    				subItem.style.paddingLeft = Math.max(0, leftPos) + 'px';
    And it will be fine.
    - John
    ________________________

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

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    deathbycheese (04-27-2012)

  4. #3
    Join Date
    May 2011
    Location
    SFBA, CA, USA
    Posts
    94
    Thanks
    6
    Thanked 7 Times in 7 Posts

    Default

    Thanks John, for pointing out the missing DD reference. I know it was on there in my earlier versions, but am not surprised it fell off sometime during the mad melee that has been this project. I will be sure to always double-check from now on.

    Also, I will try your suggestions and let you know if this resolves the issue.

    Thanks again,
    dbc

    edit:
    Wait, it DOES have the DD reference. You're probably looking at the includes only and not the actual .js file. If you know a way for the reference to be 'included' when using PHP includes, I'd be happy to adjust it accordingly.

    I knew I was a loyal DD supporter.
    Last edited by deathbycheese; 04-27-2012 at 04:50 PM. Reason: I looked at the file and...

  5. #4
    Join Date
    May 2011
    Location
    SFBA, CA, USA
    Posts
    94
    Thanks
    6
    Thanked 7 Times in 7 Posts

    Default It worked!

    John, you're a god.

    dbc

  6. #5
    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

    Quote Originally Posted by deathbycheese View Post
    Wait, it DOES have the DD reference. You're probably looking at the includes only and not the actual .js file. If you know a way for the reference to be 'included' when using PHP includes, I'd be happy to adjust it accordingly.

    I knew I was a loyal DD supporter.
    Um, the credit is supposed to be in the page's source code, not in the javascript file (though it can be there too). You took an on page script and made it external with this in the page's source code:

    HTML Code:
    <script type="text/javascript" src="./script/mainNavScript.js"></script>
    According to the rules, that should be:

    HTML Code:
    <script type="text/javascript" src="./script/mainNavScript.js">
    /***********************************************
    * Tab Menu- By Alf Magne Kalleland www.dhtmlgoodies.com
    * Script featured and available at Dynamic Drive: http://www.dynamicdrive.com/
    * This notice must stay intact for use
    ***********************************************/
    </script>
    Quote Originally Posted by deathbycheese View Post
    John, you're a god.

    dbc
    Thanks, and you're welcome.
    - John
    ________________________

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

  7. #6
    Join Date
    May 2011
    Location
    SFBA, CA, USA
    Posts
    94
    Thanks
    6
    Thanked 7 Times in 7 Posts

    Default

    Thanks. I will fix it today.

    One more issue:

    I can't get the submenu to stay visible while on a corresponding page. It times out and disappears. Do you know how to fix that? My beta testers keep complaining about it.

    Here's the link again for easy reference:
    http://www.heritagechurch.us/Sandbox

    Thanks again in advance!
    dbc

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
  •