Last active
January 29, 2022 06:04
-
-
Save bkaminski/25f064556c6549b065af43cbf83570e3 to your computer and use it in GitHub Desktop.
jQuery for rotating Bootstrap modals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
var modals = ["myModal1", "myModal2", "myModal3"]; | |
var rand = modals[Math.random() * modals.length | 0]; | |
jQuery(window).load(function(){ | |
setTimeout(function() { | |
jQuery('#' + rand).modal('show'); | |
}, 5000); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment