Refresh

This website danillolima.com/en/wordpress/correcting-the-positioning-of-mega-menu-in-oxygen-builder/ is currently offline. Cloudflare's Always Online™ shows a snapshot of this web page from the Internet Archive's Wayback Machine. To check for the live version, click Refresh.

Correcting the positioning of Mega Menu in Oxygen Builder

When using the component Mega Menu from the Composite Elements in a sticky header or when logged on WordPress the component Mega Menu compute the top offset of the menu (.oxel_megamenu__wrapper) in a wrong way.

Logged in WordPress the navbar is computed making the element stay with a top offset plus the height of the WordPress navbar.

Top margin of menu when logged

You just need change the Mega Menu Code from this:

var bottom = jQuery(this).offset().top + jQuery(this).outerHeight(true);

To this:

var bottom = jQuery(this).position().top + jQuery(this).outerHeight(true);

This way the browser will compute the top offset from the Mega Menu Links div and not from document.

2 thoughts on “Correcting the positioning of Mega Menu in Oxygen Builder

Leave a Reply

Your email address will not be published. Required fields are marked *