Search code examples
javascriptjqueryjasny-bootstrap

Call a function on closing Jasny Off canvas


I implemented jasny bootstrap in one of my webpages for Offcanvas push menu. It opens whenever i click on the button. But it closes when either I click on button again or anywhere outside(body) of Jasny Off-canvas .

How do i call a function whenever jasny off-canvas is closed. I searched for events but only body class is appended to (.canvas-slid) when canvas opens and this class gets removed on closing.

Jasny canvas i implemented is : http://jasny.github.io/bootstrap/examples/navmenu-push/


Solution

  • You should read documentation again.

    You can try :

    $('#myMenu').on('hidden.bs.offcanvas', function (e) {
         ...
    });