html 重新排序模块以放入collection.liquid内 - 可能需要CSS爱。 http://docs.shopify.com/manual/configuration/store-cust

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 重新排序模块以放入collection.liquid内 - 可能需要CSS爱。 http://docs.shopify.com/manual/configuration/store-cust相关的知识,希望对你有一定的参考价值。

<div>
  <label for="sort-by">Sort by</label> 
  <select id="sort-by">
    <option value="manual">Featured</option>
    <option value="price-ascending">Price: Low to High</option>
    <option value="price-descending">Price: High to Low</option>
    <option value="title-ascending">A-Z</option>
    <option value="title-descending">Z-A</option>
    <option value="created-ascending">Oldest to Newest</option>
    <option value="created-descending">Newest to Oldest</option>
    <option value="best-selling">Best Selling</option>
  </select>
</div>
<script>
Shopify.queryParams = {};
if (location.search.length) {
  for (var aKeyValue, i = 0, aCouples = location.search.substr(1).split('&'); i < aCouples.length; i++) {
    aKeyValue = aCouples[i].split('=');
    if (aKeyValue.length > 1) {
      Shopify.queryParams[decodeURIComponent(aKeyValue[0])] = decodeURIComponent(aKeyValue[1]);
    }
  }
}
jQuery('#sort-by')
  .val('{{ collection.sort_by | default: collection.default_sort_by | escape }}')
  .bind('change', function() {
    Shopify.queryParams.sort_by = jQuery(this).val();
    location.search = jQuery.param(Shopify.queryParams).replace(/\+/g, '%20');
  });
</script>

以上是关于html 重新排序模块以放入collection.liquid内 - 可能需要CSS爱。 http://docs.shopify.com/manual/configuration/store-cust的主要内容,如果未能解决你的问题,请参考以下文章

html 重新排序模块以放入collection.liquid内 - 可能需要CSS爱。 http://docs.shopify.com/manual/configuration/store-cust

html 重新排序模块以放入collection.liquid内 - 可能需要CSS爱。 http://docs.shopify.com/manual/configuration/store-cust

将可拖动对象放入可排序对象后,jQuery Click 事件不起作用

jQuery Draggable + Sortable - 如何拒绝放入排序?

jQuery UI 可拖动元素放入可排序

JQuery Sortable - 不能将元素拖出排序一旦放入