模态窗口一次与jQuery会话 [英] Modal window once a session with jQuery

查看:108
本文介绍了模态窗口一次与jQuery会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个脚本(最好是jQuery插件)在进入我的网站(无论哪个页面)时显示模式窗口,但在同一浏览会话中仅显示一次,因此,当用户关闭并重新打开浏览器时,他会看到模态窗口再次出现在我的网站上. 有人可以帮我吗? 谢谢

I'm looking for a script, preferably a jQuery plugin, to display a modal window when entering my website (whichever page) but only once during the same browsing session, so when the user closes and reopens the browser he sees the modal window again in my website. Can somebody help me? Thanks

推荐答案

使用cookie ...

Use cookies ...

查看 http://plugins.jquery.com/files/jquery .cookie.js.txt

请勿使用到期值(这样cookie就是会话cookie).

Do not use an expire value (so that the cookie is a session cookie)..

if ($.cookie('modal') != 'shown')
   {
     $.cookie('modal', 'shown');
     // code to show modal
   }

这篇关于模态窗口一次与jQuery会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆