2012-01-16 71 views
-6

我有這樣的代碼:如何在我的博客博客的主頁上顯示燈箱?

<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> 

的代碼是當用戶訪問我的博客出現一個類似Facebook的框。我的博客是在博客上。我的問題是,當用戶看到其他帖子或刷新頁面時,此jQuery的燈箱會一次又一次出現。我希望它只出現在網站的主頁上。我對jQuery一無所知。

+0

幫助我們在這裏...你需要更具描述性,並提供一些具體信息: 例如:當你說「這個jquery一再出現」,你的意思是特定的代碼是出現,還是你看到多個燈箱? 這個代碼在哪裏?它是否在所有頁面的模板中?如果是這樣,那就是它出現在所有頁面上的原因,而不僅僅是主頁。 – lhagemann 2012-01-16 14:54:36

回答

1

其可能全部爲&quot;。將其全部更改爲"。更改&39;'以及

+0

和'''字面 - 將其改爲'' – 2012-01-16 14:45:15

+0

我試過了,但它沒有奏效。當我移動到下一頁時,我可以再次看到燈箱。 – 2012-01-16 14:56:15

+0

你是否將它包含在模板中? – 2012-01-16 14:58:31

相關問題