The initial source comes from sdcuike/issueBlog#4
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense
| $(document).on('click', '#finish-customization', function(e){ | |
| e.preventDefault(); | |
| bundle_prefix = "{{ product.handle | replace: '-','_' }}"; | |
| bundle_id = Math.floor((Math.random() * 100000) + 1); | |
| $('input[name="properties[Custom Product ID]"]').val(bundle_prefix+'_'+bundle_id); | |
| $(this).find('span').html('Adding to Cart'); | |
| var $result = decodeURIComponent($('#AddToCartForm-{{ section.id }}').serialize()); | |
| $result = $result.split('&'); |
| // Display motivator message | |
| ShopifyAPI.saleMotivator = function(cart, cart_motivator_goal, motivator_msg_selector) { | |
| var cart_subtotal = parseFloat(cart.total_price / 100).toFixed(2); | |
| var cart_motivator_goal = cart_motivator_goal; | |
| var cart_motivator_goal_remaining = parseFloat(cart_motivator_goal - cart_subtotal).toFixed(2); | |
| var motivator_msg = motivator_msg_selector; | |
| if (cart_subtotal == 0) { | |
| motivator_msg.html('FREE SHIPPING ON ORDERS OVER $' + cart_motivator_goal); | |
| } else { | |
| if (cart_subtotal >= cart_motivator_goal) { |
| 1. add snippet to cart.liquid file at the bottom of the file | |
| {% include 'upsell-modal' %} | |
| 2. add css to theme.liquid in the header | |
| {{ 'upsell-modal.scss' | asset_url | stylesheet_tag }} |
| {% assign current_product_handle = product.handle %} | |
| {% assign upsell_product_col = 'col-xs-4' %} | |
| {% assign sum = product.price %} | |
| {% assign number_of_upsell_products = 0 %} | |
| {% for upsell_product in upsell_collection.products limit: 4 %} | |
| {% unless upsell_product.handle == current_product_handle %} | |
| {% assign sum = sum | plus: upsell_product.price %} | |
| {% endunless %} | |
| {% assign number_of_upsell_products = forloop.index %} | |
| {% endfor %} |
https://github.com/PacktPublishing free to download books code by Packet
https://github.com/EbookFoundation/free-programming-books Very immense
如
<a href="#home" class="none">Home</a>
<a href="#information" class="icon1 iconfont">Infor</a>类 icon1 iconfont 通过伪元素 :before 应用了 iconfont 字体图形的样式类。
上面在没有 span 元素的情况下,各浏览器对 icon1 iconfont 样式的渲染在 a 中的实体方面产生了不一样的行为:
先来看一个例子
var Arr = [100, 200, 300, 400, 500]
function fn (arr) {
arr.forEach(function(item, index, array){
if(item == 300) {
return index;
console.log(index);
}
先来了解一下 border-collapse 属性,该属性只属于具有(或设置了) display:table | table-inline 属性的元素。如下:
proprity: border-collapse
Values: collapse | separate | inherit
Initial value: separate
Applies to: Elements with the display value table or table-inline
Inherited: Yes
Computed value: As specified
Note: In CSS2, the default was collapse.
input、select 与 textarea 元素虽然都是表单元素中的 内行块级元素(默认 display:inline-block;),但是它们的区别还是挺大的。不仅仅表现在 padding、border-width等常见属性上,更表现在box-sizing 属性上。
box-sizing 属性区别:
input 元素的默认 box-sizing 属性表现为 content-box,即 W3C 标准盒模型;select 与 textarea 元素的默认 box-sizing 属性表现为 border-box,即 IE(怪异)盒模型;注:在 Chrome 的
开发者工具里面各元素的默认box-sizing属性只在其值为box-sizing时才显示出来;没显示出来的,其值都默认为content-box。
select {
appearance:none;