PRO Header - Launch Off Canvas navigation fro button

In the PRO header, is it possible to launch an off canvas navigation from clicking on a button element?

Hi @King,

Thanks for reaching out.

Sure, it’s possible. All you need is add an ID to your off canvas, example,

The navigation collapsed

The button

Then you can add a jQuery code in your global custom javascript section

jQuery ( document ).on('click', '#button_id_here', function(e) {

e.preventDefault();

//open the off canvas by triggering its click action

jQuery ('#off_canvas_id-anchor-toggle').trigger('click');

} );

Notice that we only use the ID off_canvas_id for navigation collapse, but it needs this #off_canvas_id-anchor-toggle for triggering it (format is #{ custom ID here }-anchor-toggle).

This is just a sample and provided as an idea, you can use your preferred IDs and repeat it over and over. But we can’t provide further customization regarding this.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.