Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save omurphy27/391d2d58eeb7a4603108 to your computer and use it in GitHub Desktop.
Save omurphy27/391d2d58eeb7a4603108 to your computer and use it in GitHub Desktop.
Show bootstrap modal window only once onload via JS Cookie.js
@razinbunsu
Copy link

This will fix the modal to show only once
if ( !Cookies.get('popup') ) { setTimeout( function() { $('#siteModal').modal().on('shown.bs.modal', function() { Cookies.set('popup', 'true', { expires: 3, path: "/" }); }); }, 600); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment