Wednesday, March 7, 2012

No SharePoint 2007 Menu Flyouts/DropDowns in Chrome

Broken Navigation Menus

As of Chrome 15 (we think) SharePoint 2007 sites started to behave a little funky. The stock SharePoint menu started to behave erratically, intermittently not showing navigation flyouts. To be clear, on every other page load the navigation would behave appropriately, but the other half of the time the menu wouldn’t do anything on hover, making it impossible to see sub navigation items under a given header.
This seems to affect all SP 2007 sites for Chrome version 15 and later. The error strangely enough seems to be more related to javascript than rendering behavior.

The Fix

I’ll save you the troubleshoot, we added a late loading script that tells the menu that flyouts are indeed kosher. For some reason this variable gets set incorrectly for newer versions of Chrome. There’s a good chance MS may not release a fix for this since Chrome isn’t a supported browser for SharePoint 2007.
<script type="text/javascript">
$(function(){
    //Updates the stock SharePoint menu settings to allow flyouts,
    //seems to get intermittently improperly set on Chrome >= 15.
    flyoutsAllowed = true;
});
</script>
That’s it, pretty simple (especially if you already have some jQuery running around). Otherwise you can get by having the script run really late in the document life cycle.

Hope that Helps Someone,
Tyler

7 comments:

Anonymous said...

Thanks..It worked!!

Alfresco Development said...

You have give us nice solution in your article.Its really useful for us.

The JNorky said...

Where do you insert this code? Master page? Page layout?

Cedric Giffart said...

Thanks a lot, we was really wondering how to solve this problem.
Your solution works perfectly!

Anonymous said...

Thanks for posting. Ian Smith.


Anonymous said...

Will this work for Share point 2010 web application?
I'm facing this issue in my Share point 2010 web application.

Anonymous said...

Add your browser user agent to sharepoints browser.compat file and you won't need these ad-hoc javascrips