Display Bootstrap Modal First time page loads

前端 未结 7 1710
遇见更好的自我
遇见更好的自我 2020-12-16 05:27

I\'m trying to display a bootstrap modal when a person first visits a page (after logging into my app). I want to use the modal to offer a \"Getting Started\" video and also

相关标签:
7条回答
  • 2020-12-16 06:00

    You can use jquery.cookies.js in combination with modal.js to load the page only once then set an expiry cookie.

                <script src="/path/to/jquery.cookie.js"></script>
                <script>
                $(document).ready(function() {
                     if ($.cookie(‘pop’) == null) {
                         $(‘#myModal’).modal(‘show’);
                         $.cookie(‘pop’, ’7');
                     }
                 });
                </script>
    

    You can find more details in this tutorial:

    http://calebserna.com/bootstrap-modal-email-subscription-form/

    0 讨论(0)
提交回复
热议问题