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 597 forks source link

Real example of Remotly Load content with jquery and Ajax #340

Closed duplex13100 closed 6 years ago

duplex13100 commented 6 years ago

Hello,

In the examples that we can dowload with the projet, none of the jquery examples are working in my localhost.

Could you give an example of a working jquery sidr menu using Ajax with a close button ?

I try to use it : it load the menu, but I'm not able to close it.

Edit : I have made some progress : I can close the menu, but I'm not able to re-open it.

I use the function : $(document).ready(function() { $('#sidr-id-closebtn').click(function() { $('html').removeAttr('style'); $('body').removeAttr('style'); $('body').removeClass('sidr-open'); $('body').removeClass('sidr-remote-content-open'); $('#sidr-remote-content').removeAttr('style'); $('#sidr-remote-content').css('display', 'none'); }); });

duplex13100 commented 6 years ago

It was my error : I had including for a second time sidr in the Ajax loaded content so 2 instances of the sidr class where present and the close buttun wasn't able to close the menu properly.