[英]fancybox to show up only the first time when page land on
如何安装fancybox以仅在第一次访问首页时显示。 其中应包括:
<h1> Please select your language </h1>
<div> class="select-language" </div>
无论您登陆哪个页面,fancybox都只会显示一次。
You can try this.
$(document).ready(function{
if (! $.cookie("cookieName")){
// do your stuff
// set cookie now
$.cookie("cookieName", "firstSet", {"expires" : 7})
}
})
尝试使用以下代码和cookie,
$(document).ready(function() {
var visited = $.cookie('visited');
if (visited == 'yes') {
return false;
} else {
$.fancybox({
'width': '60%',
'height': '80%',
'autoScale': true
});
}
$.cookie('visited', 'yes', { expires: 7 });
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.