Monday, January 16, 2012

I want to show the lightbox on only homepage of my blog.but somethings wrong


I have this code:




<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js'/>

<script src='https://gj37765.googlecode.com/svn/trunk/html/[www.gj37765.blogspot.com]jquery.colorbox-min.js'/>
<link href='https://gj37765.googlecode.com/svn/trunk/html/%5Bwww.gj37765.blogspot.com%5Dfbpopup.css' rel='stylesheet' type='text/css'/>
<script type='text/javascript'>
jQuery(document).ready(function(){
if (document.cookie.indexOf(&#39;visited=flase&#39;) == -1) {
var fifteenDays = 1000*60*60*24*30;
var expires = new Date((new Date()).valueOf() + fifteenDays);
document.cookie = &quot;visited=false;expires=&quot; + expires.toUTCString();
$.colorbox({width:&quot;400px&quot;, inline:true, href:&quot;#mdfb&quot;});
}
});
</script>



The code is for a Facebook-like box which appears when a user visits my blog. My blog is on blogger. My problem is that the lightbox of this jquery appears again and again whenever a user sees other posts or refreshes the page. I want it to appear only on the home page of site. I don't know anything about jQuery.

1 comment:

  1. Likely its all the &quot;. Change all of them to ". Change &39; to ' as well

    ReplyDelete