2012-05-17 22 views
0

我正在運行一個bigcommerce商店,並在站點頁腳中安裝了hello欄自定義代碼。我也嘗試在各種位置(頭文件模板文件,默認模板文件,頁面特定模板文件)中放置hellobar代碼。由於某種原因,hello-bar只能在我的主頁上使用,而不能在任何其他頁面上使用。不好的javascript?你好酒吧獨奏只在主頁上工作 - 沒有其他頁面

任何想法爲什麼?看起來好像我把它放在頁腳中它應該顯示在每一頁上,但這不是我所得到的。如果您需要更多詳細信息或代碼示例以幫助,請告訴我。

感謝

順便說一句,支持的Bigcommerce也認爲,hellobar應該在每一頁上顯示出來,如果我在頁腳這個代碼,但它不工作。我的猜測是,這是JavaScript,但我不知道我的方式。

下面是我使用的代碼:

<div id="mailchimp_form" style="display:none;"> 
<form action="http://xxxxx.us5.list-manage.com/subscribe/post" method="POST"> 
<input type="hidden" name="u" value="xxxxxxxx"> 
<input type="hidden" name="id" value="xxxxx"> 
Get an instant coupon code by signing up to our newsletter. Email: <input type="email" autocapitalize="off" autocorrect="off" name="MERGE0" id="MERGE0" size="25" value="" /> 
<input class="button" type="submit" value="Subscribe" /> 
</form> 
</div> 
<!-- Hello Bar configuration start --> 
<script type="text/javascript"> 
var mailChimpForm = document.getElementById('mailchimp_form').innerHTML; 
new HelloBar(mailChimpForm, { 
    showWait: 1000, 
    positioning: 'sticky', 
    fonts: 'Arial, Helvetica, sans-serif', 
    forgetful: true 
}, 1.0); 
</script> 

這裏是我放在標題中引用:

<link type="text/css" rel="stylesheet" href="content/hellobar.css" /> 
<script type="text/javascript" src="content/hellobar.js"></script> 
+0

我們可以看到發生在某處嗎? – Tamil

回答

0

不知道是什麼樣的Bigcommerce,但是從判斷你提供的是我猜兩個原因之一。

  1. 除您的主頁上沒有「mailchimp_form」div。
  2. 由於某種奇怪的原因,Javascript會在'mailchimp_form'div在所有其他頁面上加載之前執行。
相關問題