让 FaceBox 只显示一次
现在我正在创建一个代码,其中 Facebox(灯箱插件)仅为每个人显示一次。但它只是不起作用
我的代码是:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<link href="http://weebuild.biz/resources/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css">
<script src="http://weebuild.biz/resources/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'http://weebuild.biz/resources/facebox/loading.gif',
closeImage : 'http://weebuild.biz/resources/facebox/closelabel.png'
});
});
</script>
<script type="text/javascript">
function getCookie(c_name){
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++){
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name){
return unescape(y);
}}}
function setCookie(c_name,value,exdays){
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
$(document).ready(function(){
// alert(document.cookie);
var cookieyes=getCookie("comin223");
if(cookieyes!==null&&cookieyes!==""){
return false();
}
else{
jQuery.facebox({ div: '#cookie_box' });
setCookie("comin223","yes",365);
}
});
</script>
<style type="text/css">
#whats-new p {
margin-top:15px;
}
.dashed {
border-top:1px dotted black;
}
</style>
<div id="cookie_box" style="display:none;width:500px;">
<span style="font-size:18px;font-weight:bold;">What's Coming Soon</span>
<div class="dashed"></div>
<p>We will soon have a Contact Us Button in between the Request Tool and Report Bug Button</p>
<br>
<p><b><span style="color:red;">NOTE: This will only show up once!</span></b></p>
</div>
这应该做的只是显示“即将推出”框一次。问题是 Facebox 无法工作,而且看起来设置正确。
Right now I'm creating a code where the Facebox (lightbox plugin) only shows once for each person. But it its just not working
My code is:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<link href="http://weebuild.biz/resources/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css">
<script src="http://weebuild.biz/resources/facebox/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'http://weebuild.biz/resources/facebox/loading.gif',
closeImage : 'http://weebuild.biz/resources/facebox/closelabel.png'
});
});
</script>
<script type="text/javascript">
function getCookie(c_name){
var i,x,y,ARRcookies=document.cookie.split(";");
for (i=0;i<ARRcookies.length;i++){
x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
x=x.replace(/^\s+|\s+$/g,"");
if (x==c_name){
return unescape(y);
}}}
function setCookie(c_name,value,exdays){
var exdate=new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
document.cookie=c_name + "=" + c_value;
}
$(document).ready(function(){
// alert(document.cookie);
var cookieyes=getCookie("comin223");
if(cookieyes!==null&&cookieyes!==""){
return false();
}
else{
jQuery.facebox({ div: '#cookie_box' });
setCookie("comin223","yes",365);
}
});
</script>
<style type="text/css">
#whats-new p {
margin-top:15px;
}
.dashed {
border-top:1px dotted black;
}
</style>
<div id="cookie_box" style="display:none;width:500px;">
<span style="font-size:18px;font-weight:bold;">What's Coming Soon</span>
<div class="dashed"></div>
<p>We will soon have a Contact Us Button in between the Request Tool and Report Bug Button</p>
<br>
<p><b><span style="color:red;">NOTE: This will only show up once!</span></b></p>
</div>
What this is suppose to do is only show the Coming Soon box once. The problem is the facebox is not working and it looks setup correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,将行更改
为
其次,将行更改
为
已排序!!!
Firstly, change line
to
Secondly, change line
to
Sorted!!!