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

  • SEARCH
  • Home
  • 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 8439145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:55:39+00:00 2026-06-10T07:55:39+00:00

I am using jQuery and jQuery-UI to make a navigation menu for a project

  • 0

I am using jQuery and jQuery-UI to make a navigation menu for a project I am working on and am having a strange issue with the jQuery animation in Internet Explorer. The code finds a tag that is nested i na specific order (li ul li a OR li ul li h3) and adds a class to the tag, which is used to toggle the content visibility. The jQuery code I am using can be seen here:

(function ($) {
$.fn.menuLocator = function (options1) {
    var defaults = {

    };

    var options = $.extend(defaults, options1);

    return this.each(function () {
        var menu = this;
        var basePath = window.location.href.split(window.location.host)[1];
        var paths = basePath.split('.html').join('').split('/');
        for (var i = 1; i != paths.length; i++) {
            $(menu).find('a[href$="' + paths[i] + '"]').addClass('active').addClass('level_' + i).parent().find('ul:first').addClass('active');
            $('a.active').find('.has_children:first').addClass('open');
        }
        $(menu).find('li ul').parent().find('a:first').append('<span class="has_children"><span class="icon"></span></span>');

for (var i = 1; i != paths.length; i++) {
            $(menu).find('a[href$="' + paths[i] + '"]').addClass('active').addClass('level_' + i).parent().find('li h3').addClass('active');
            $('h3.active').find('.has_children').addClass('open');
        }


        $(menu).find('li ul').parent().find('h3').append('<span class="has_children"><span class="icon"></span></span>');


        $(menu).find('.has_children').toggle(

        function () {
            var is_old_ie = false;
            var speed = 200;

            if($.browser.msie){
                is_old_ie = true;
            }

            if(is_old_ie){
                speed = 1;
            }

            $(this).parent().parent().addClass('active');
            $(this).parent().next('ul').slideToggle(speed);
            $(this).toggleClass('open');
        },

        function () {
            var is_old_ie = false;
            var speed = 200;

            if($.browser.msie){
                is_old_ie = true;
            }

            if(is_old_ie){
                speed = 1;
            }

            $(this).prevAll(":has(.active):first").removeClass('active');
            $(this).parent().next('ul').slideToggle(speed);
            $(this).toggleClass('open');
        });
    });
};
}(jQuery));

In Chrome, Firefox, Safari and Opera, everything works fine. But in IE (7, 8, 9) I get the following bug:

The navigation displays fine initially:

Initial navigation

When a user clicks the icons, each section expands to show sub-navigation:

Opening section Opening another section

However, when you close the section immediately above an open section, the content does not shift up to match the menu.

Content shifts

If you open and close the section above, it will continue to push content down, but won’t push it up.

Pushing continues

Closing and re-opening a sub-menu will cause the content to reset. Opening items in the sub-menus cause the content to shift down and up as expected.

The menu is created using the following HTML:

<!-- Left zone -->
<div class = "zoneLeft" style = "float: left;" >
<div class = "leftColumn" >

<ul class = "menu" >
    <li>
        <a> In This Section < /a>
        <ul id="menuElem">
            <li><a href="/Legal / Sunshine - Laws / Open - Government / Your - Rights - to - an - Open - and - Accountable - Government " >Your Rights to an Open and Accountable Government</a></li>
        </ul>
    </li>
    <li>
        <a>Related</a>
        <ul>
            <li><a href=" / About - AG / Contact ">Contact</a></li><li><a href=" / Legal / Sunshine - Laws / Sign - Up - For - Updates - to - ohio - s - Sunshine - Laws ">Sign Up For Updates to Ohio&#39;s Sunshine Laws</a></li>
            <li><a href=" / FAQ / Sunshine - laws - FAQs ">Sunshine Laws FAQs</a></li><li><a href=" / Legal / Sunshine - Laws / Sunshine - Laws - Publication - Request - Form ">Sunshine Laws Publication Request Form</a></li>
            <li><a href=" / Legal / Sunshine - Laws / Sunshine - Law - Training ">Sunshine Laws Training</a></li>
        </ul>
    </li>
    <li>
        <a>Publications</a>
        <ul id="p_lt_zoneContent_pageplaceholder1_pageplaceholder1_lt_zoneLeft_TagDisplayPublications_BListTagged " class="subCMSListMenuUL ">
            <li><a href=" / Files / Publications / Publications -for -Legal / Sunshine - Laws / 2012 - Sunshine - Laws - Manual.aspx ">2012 Sunshine Laws Manual</a></li>
            <li><a href=" / Files / Publications / Publications - for -Legal / Sunshine - Laws / Appendix - A - % e2 % 80 % 93 - Statutes - Public - Records, - Open - Meeting.aspx ">Appendix A – Statutes: Public Records, Open Meetings &amp; Personal Information Systems Act</a></li>
            <li><a href=" / Files / Publications / Publications - for -Legal / Sunshine - Laws / Appendix - B - % e2 % 80 % 93 - Statutory - Excepting - Records - from - the.aspx">Appendix B – Statutory Excepting Records from the Ohio Public Records Act or Declaring Records</a></li>
            <li><a href=" / Files / Publications / Publications - for -Legal / Sunshine - Laws / Appendix - C - % e2 % 80 % 93 - Ohio - Attorney - General - Opinions - Interp.aspx ">Appendix C – Ohio Attorney General Opinions Interpreting Ohio’s Public Records Act</a></li>
            <li><a href=" / Files / Publications / Publications - for -Legal / Sunshine - Laws / Appendix - D - % e2 % 80 % 93 - Ohio - Attorney - General - Opinions - Interp.aspx ">Appendix D – Ohio Attorney General Opinions Interpreting Ohio’s Open Meetings Act</a></li>
            <li><a href=" / Files / Publications / Publications - for -Legal / Sunshine - Laws / Model - Public - Records - Policy.aspx ">Model Public Records Policy</a></li>
        </ul>
    </li>
</ul>
</div>
</div>

Any ideas are appreciated. Thanks!

  • 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-06-10T07:55:41+00:00Added an answer on June 10, 2026 at 7:55 am

    Before I post my solution to this problem, let me preface it by saying that I am aware that this is a terrible way of fixing this bug. The issue only occurs on a couple pages, and we have decided to fix it in post-production. Hopefully this will not be the final solution.

    That being said, I fixed the animation issue by triggering click events when a panel is closed. Since the content in a panel resets when it is closed and re-opened, I used the following code to trigger two click events (close/re-open) on each section following the active section. In IE, the animation duration is set to 0 ms anyways, so this content reset is not visible to the user. Additionally, there is a minimal performance loss, since if the panels are open the content has already been rendered and does not need to be reloaded.

    $(menu).find('.has_children').toggle(
    
            function() {
                var speed = 200;
    
                if ($.browser.msie) {
                    speed = 0;
                }
    
                $(this).parent().parent().addClass('active');
                $(this).parent().next('ul').slideToggle(speed);
                $(this).toggleClass('open');
            },
    
            function() {
                var speed = 200;
    
                if ($.browser.msie) {
                    speed = 0;
                }
    
                $(this).parent().parent().removeClass('active');
                $(this).parent().next('ul').slideToggle(speed);
                $(this).toggleClass('open');
    
                /* IE7 Nav Push Bug Fix */
                if ( $.browser.msie && $.browser.version.slice(0,1) == "7" ) {
                    $(this).parent().parent().nextAll().children('a').children().children().trigger('click');
                    $(this).parent().parent().nextAll().children('a').children().children().trigger('click');
                }
                /* End */
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm making a vertical navigation menu using css and jquery to make the submenus
I would like to make a color fading navigation menu using jQuery, in which
I'm using jQuery to make a fixed drop down sub-navigation at the top of
I'm using jQuery to make a calculator. The issue is that on keydown, I
im using jquery to make ajax requests. is it possible to detect if the
I am using jQuery to make a POST to a PHP file with the
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I'm currently using jQuery to make a div clickable and in this div I
I am using jQuery to make an AJAX call to a ruby method in
I'm using JQuery to make a JSON request back to the server and it

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.