Сейчас я создаю код, в котором 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 не работает и выглядит правильно.