artberri / sidr

Sidr is a jQuery plugin for creating side menus and the easiest way for doing your menu responsive.
http://www.berriart.com/sidr/
MIT License
2.89k stars 595 forks source link

close handler removing style rules from body element #141

Closed jbyrneirl closed 8 years ago

jbyrneirl commented 10 years ago

Hi,

I've a Google Translate widget on site (http://fingal.ie) which adds a style attribute ('top: 40px;') to the body element when you click on the 'Gaeilge' link on the mobile menu.

However when you close the mobile menu, the SIDR close handler is removing the 'top:40px' style and as a result the Google Translate frame overlaps the top of the page.

I've tried resetting the style using my own onClose handler function but it appears that the SIDR handler is called after my onClose handler is called and so I can't reset 'top' back to the original value.

Any ideas on how I can resolve this issue?

cheers,

James B.

tomaszmrozinski commented 10 years ago

Hi,

To fix this you need to replace line 163 and 164 in jquery.sidr.js file with this:

$body.css('width', '').css('position', '').css('right', '').css('left', ''); $('html').css('overflow-x', '');

Thanks, Tomasz