0

我正在经营一家大型商业商店,并在网站页脚中安装了 hello bar 单独的自定义代码。我还尝试将 hellobar 代码放置在各个位置(标题模板文件、默认模板文件、页面特定模板文件)。出于某种原因,hello-bar 只能在我的主页上使用,而不能在任何其他页面上使用。

关于为什么的任何想法?好像如果我把它放在页脚中,它应该出现在每一页上,但这不是我得到的。如果您需要更多详细信息或代码示例来帮助,请告诉我。

谢谢

顺便说一句,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> 
4

1 回答 1

0

不知道 bigcommerce 是什么,但从您提供的内容来看,我猜测是两个原因之一。

  1. 除了您的主页外,没有“mailchimp_form” div。
  2. 由于某些奇怪的原因,Javascript 确实在“mailchimp_form” div 加载到所有其他页面之前执行。
于 2012-05-17T05:31:57.770 回答