我已经使用 bpopup 在我的主页上成功添加了全屏弹出窗口。
它工作得很好,但只有在按下按钮时才有效。我希望弹出窗口出现在主页上,并且只在用户第一次访问该网站时出现在主页上。
我的代码是:
<script>
   // Semicolon (;) to ensure closing of earlier scripting
    // Encapsulation
    // $ is assigned to jQuery
    ;(function($) {
         // DOM Ready
        $(function() {
            // Binding a click event
            // From jQuery v.1.7.0 use .on() instead of .bind()
            $('button').bind('click', function(e) {
                // Prevents the default action to be triggered. 
                e.preventDefault();
                // Triggering bPopup when click event is fired
                $('#announce').bPopup();
            });
        });
    })(jQuery);
</script>
这很好用,但我如何向它添加与 cookie 相关的处理程序?
提前感谢您的帮助。它真的很感激。