WordPress.org

Forums

iNove
[resolved] Inove menu not compatible with WP 3.2 (6 posts)

  1. robpannell
    Member
    Posted 3 years ago #

    Having upgraded from wordpress 3.1 to 3.2 the javascript navigation bar in the header no longer functions in IE. the menus don't drop down when you rollover them.

    It must be to do with changes in WP, as I've since downgraded back to 3.1 and it operates fine again.

    I'd love for this to be fixed (or learn of a fix I can apply myself) so I can run the newer WP.

  2. sampdelaney
    Member
    Posted 3 years ago #

    Hi robpannell,

    I think I've been able to solve this problem and it seems to be a problem with the javascript located in menu.js

    I managed to trace the entire script to work out how it works and it is related to some code on lines around 181-8. I'm assuming what this code does is to work out when the document has been loaded by inserting a snippet into the head of the document and waiting for it to be rendered (setting the readyState of the element to 'complete').

    Eventually, after a few attempts the readystate is finally set to 'complete' and loadMenus() is called (lines 150-76). On line 163 the script attempts to get the menubar and load all the menus associated with it. The only problem I've encountered is that document.getElementById('menu') returns null which leads me to believe that it hasn't been rendered yet.

    To wait until the menu has been rendered I waited for the document's readyState to be set as complete and then called loadMenus();

    Original Code (lines 182-88):

    document.write('<script id="__ie_onload_for_inove" defer src="javascript:void(0)"></script>');
    	var script = document.getElementById('__ie_onload_for_inove');
    	script.onreadystatechange = function() {
    		if (script.readyState == 'complete') {
    			loadMenus();
    		}
    	}

    New Code:

    //document.write('<script id="__ie_onload_for_inove" defer src="javascript:void(0)"></script>');
    	//var script = document.getElementById('__ie_onload_for_inove');
    	document.onreadystatechange = function() {
    		if (document.readyState == 'complete') {
    			loadMenus();
    		}
    	}

    Cheers,

    Sam

  3. robpannell
    Member
    Posted 3 years ago #

    I finally found time to give this a shot.
    It's fantastic, worked a treat.

    Thank you!

  4. chrisglobal
    Member
    Posted 3 years ago #

    Thanks Sam... been frustrated by this one..

  5. GurtDotCom
    Member
    Posted 3 years ago #

    You are awesome!!

    Thank you

  6. frankiebs
    Member
    Posted 3 years ago #

    Thanks a lot, You saved my time :)

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags