Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active February 8, 2022 22:52
Embed
What would you like to do?
open offcanvas after page load and after delay
jQuery(document).ready(function($) {
let offCanvas = '.my-offcanvas'; // Change to your offcanvas selector (class or ID)
let delay = 1000; // Number of ms to wait before opening offcanvas
setTimeout(function(){
/* Add the classes to open the offcanvas */
$('html,body').addClass('off-canvas-toggled');
$(offCanvas).addClass('oxy-off-canvas-toggled');
}, delay);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment