我正在尝试编辑要自定义http://radiantiger.bigcartel.com/product/hhhgtf的网站的“添加到购物车”按钮。我希望客户单击“添加到购物车”按钮,然后直接进入购物车。
1)我知道我必须编辑添加到购物车按钮的javascript,该怎么做? &我应该使用什么代码?
2)如何从侧边栏的左上方移动“购物车按钮”,使其与我的“添加到购物车按钮”内联,如下所示:http://dl.dropbox.com/u/90031565/Fullscreen%20capture%20382013%2050354%20PM.jpg
我尝试将“购物车按钮”与“添加到购物车按钮”放到同一div中,但它无法实时显示购物车功能中的内容。
先感谢您。
最佳答案
您需要将cart_nav_list从旁边的栏中移到ID add_cart中。
因此,例如,您的代码应如下所示:
<div id="add_cart">
<button class="button" type="submit" name="submit" id="add_to_cart">Add to Cart</button>
<ul class="clearfix" id="cart_nav_list">
<li id="cart_button">
<a id="open_cart" href="/cart">Cart
<div class="clearfix" id="cart_info">
<span id="cart_count">0</span>
<span id="cart_divider">|</span>
<span id="cart_total"><span class="currency_sign">$</span>0.00</span>
</div>
</a>
</li>
</ul>
</div>
附有屏幕快照,以显示在何处找到这些元素的更多信息。要查看类似我粘贴的信息,请安装firebug。
html5 move cart rightside http://www.bybe.net/downloads/html5-move-cart-rightside.png
另外,要使元素并排工作,您需要对样式表进行次要编辑,如下所示:
#add_cart button, #cart_nav_list {
float:left;
}