Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click offcanvas-outer to hide. #4

Open
ivorpad opened this issue Jan 25, 2017 · 2 comments
Open

Click offcanvas-outer to hide. #4

ivorpad opened this issue Jan 25, 2017 · 2 comments

Comments

@ivorpad
Copy link

ivorpad commented Jan 25, 2017

Can't get my head around this:

$($el).on('shown.offcanvas', function() {
    $('.offcanvas-outer').on('click', function() {
      $el.offcanvas('hide');
    });
});

Once hidden the trigger doesn't work correctly.

@lgraubner
Copy link
Owner

You can achieve this by setting overlay: true and overlayColor: transparent. The overlay spans over the whole content and closes the offcanvas part on click. The transparent makes it invisible.

@ivorpad
Copy link
Author

ivorpad commented Jan 26, 2017

Yeah I tried that, unfortunately overlay: true is giving me performance issues.

I'm using esc in the meantime.

$($el).on("shown.offcanvas", function() {
    $(document).keyup(function(e) {
      if( e.keyCode === 27 ) {
        $el.offcanvas("hide");
      }
    });
});

By the way, thanks for the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants