Skip to content

Instantly share code, notes, and snippets.

@wplit
Last active February 8, 2022 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wplit/aad33f39d94fb783402d7c3b0a45699f to your computer and use it in GitHub Desktop.
Save wplit/aad33f39d94fb783402d7c3b0a45699f to your computer and use it in GitHub Desktop.
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