Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 650763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:05:18+00:00 2026-05-13T22:05:18+00:00

I built a site about 6 months ago now and designed a menu with

  • 0

I built a site about 6 months ago now and designed a menu with some interactivity using jQuery. It worked great in my friends (Firefox, Safari, etc).

Turns out that now IE7 & 8 are not playing ball.

The error in IE points to jQuery (on Google’s CDN) with invalid argument.

The page can be viewed here. Move your mouse over the top headers to see what should happen in Firefox. This isn’t happening in IE7/8.

Here is the source code of my effect

String.prototype.safe = function() {
    var string = this;
    string = string.toLowerCase().replace(/\s/g, '-');
    string = string.replace(/&/g, 'and'); // & appears as just &
    return string;
}

var subMenu = {
    activeMenuId: 'submenu-about-us',
    hideDelay: null,
    init: function(){
        var self = this;
        $('#header').append('<div id="sub-menu"></div><div id="hover"></div>');
        $('#background-elements').append('<span></span>');

        var $subMenu = $('#sub-menu');
        var $hover = $('#hover');

        $('#menu li ul').each(function(){
            var id = 'submenu-' + $(this).parents('li').find('.inner').text().safe();
            $(this).attr({
                id: id
            }).prependTo($subMenu);
        });

        // move slider to where it should be

        var uri = document.location.pathname;

        uri = uri.replace(PATH_BASE + '/', '')

        var uriSegments = uri.split('/');

        var currentCategory = uriSegments[0];

        if (currentCategory) {

            var uriSegmentToListIndex = {};

            uriSegmentToListIndex['about-us'] = 0;
            uriSegmentToListIndex['tenant-advice-and-advocacy'] = 1;
            uriSegmentToListIndex['housing-services'] = 2;
            uriSegmentToListIndex['tenants'] = 3;
            uriSegmentToListIndex['applicants'] = 4;
            uriSegmentToListIndex['housing-development-projects'] = 5;
            uriSegmentToListIndex['news-and-publications'] = 6;
            uriSegmentToListIndex['contact'] = 7;

            var currentListItemIndex = uriSegmentToListIndex[currentCategory];

            var sliderDropShadowOffset = 14;

            if (currentListItemIndex) {

                var sliderLeft = $('#menu > li:eq(' + currentListItemIndex + ')').position().left + sliderDropShadowOffset;
            }

            $hover.css({
                left: sliderLeft + 'px'
            });

            this.activeMenuId = 'submenu-' + currentCategory;

            // make the right sub menu appear

            $subMenu.find('ul').hide();
            $('#submenu-' + currentCategory).fadeIn(500);
        }




        $('#menu li .inner').parents('li').hoverIntent(function(){

            var id = 'submenu-' + $(this).find('.inner').text().safe();

            if (id != self.activeMenuId) {

                self.activeMenuId = id;

                $subMenu.find('ul').hide();

                var newLeft = $(this).position().left + sliderDropShadowOffset; // offset for drop shadow



                $hover.animate({
                    left: newLeft + 'px'
                }, 500, function(){
                    $subMenu.find('ul').hide(); // sometimes some remain
                    $('#' + id).fadeIn(800);

                });

            }



        }, function(){
            // do nothing!

        });


    }



}

I’ve tried the usual suspects and had a go with IE8 developer tools, but have not figured this one out yet. So I’m turning to the Stack Overflow community 🙂

Anyone know the issue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:05:19+00:00Added an answer on May 13, 2026 at 10:05 pm

    The error occurs in this line on IE 8:

    $hover.css({
        left: sliderLeft + 'px'
    });
    

    The sliderLeft variable never gets initialized because currentListItemIndex is 0:

    if (currentListItemIndex) {
        var sliderLeft = $('#menu > li:eq(' + currentListItemIndex + ')').position().left + sliderDropShadowOffset;
    }
    
    >> currentListItemIndex
    0
    
    >> sliderLeft
    undefined
    

    Updated

    IE 8 has a really good built-in debugger (finally):

    1. Make sure it’s not disabled by going to Tools -> Advanced and un-checking the “Disable script debugging (Internet Explorer)” option.

    2. When the browser hits the error on the page you will receive a dialog box asking if you want to run the debugger. Make sure the “Use the built-in script debugger in Internet Explorer” option is checked. Hit “Yes” to start the debugger.

    3. A lot of times jQuery code will error out when passed an unexpected value. This isn’t very helpful initially because the problem is rarely jQuery’s fault and most of the time the code is minimized anyway. You will need to select the “Call Stack” tab in the debugger and then follow the calls up the stack until you reach your code that caused the problem. That’s how I was able to find the exact line in your script.

    4. You can use the Console, Locals and Watch tabs to run some script or view the current state of the variables being used at the moment the error occurred (like the currentListItemIndex and sliderLeft variables).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Our team has built a site using Sharepoint and a few custom webparts. We've
My site has a drop-down menu built in CSS and JavaScript that drops down
A site I am working on that is built using PHP is sometimes showing
I originally built my site in MVC 1.0 using the NerdDinner tutorial as a
Using Python, I built a scraper for an ASP.NET site (specifically a Jenzabar course
I've just built a basic ASP MVC web site for deployment on our intranet.
We have a hosted site that has a CMS we built running on a
I customize a WSS site definitions by tweaking one of the built in definitions.
We're building a CMS. The site will be built and managed by the users
I've been building a Ruby on Rails site in recent months and I've only

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.