Skip to content

Instantly share code, notes, and snippets.

@tairli
tairli / old-tabbed-description.liquid
Last active January 24, 2021 10:37
Old tabbed description code without stop
{% comment %}
if combine_pretext is false, the text before the first <h6> will be shown above all tabs, otherwise added to the first tab
{% endcomment %}
{% assign combine_pretext = false %}
{% assign description = tabbed-description | default: product.description %}
{% if description contains "<h6>" %}
{% assign tab_heads = '' %}
{% assign tab_texts = '' %}
{% assign pretext = '' %}
@tairli
tairli / index.html
Created December 9, 2019 17:03
Shopify API filter for product prices
<!DOCTYPE html>
<html class="no-js">
<head>
<meta charset="utf-8">
<title>Shopify filtering Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="_assets/css/style.css">
</head>
<body>
@tairli
tairli / clickable-element.html
Last active December 9, 2019 16:49 — forked from scottmagdalein/clickable-element.html
Make the Mailchimp Subscriber popup appear on click
<!-- This is the HTML element that, when clicked, will cause the popup to appear. -->
<button id="open-popup">Subscribe to our mailing list</button>
@tairli
tairli / t_sticky.js
Last active May 7, 2018 07:03
Add to the very bottom of the theme.js.liquid to hide an element when scrolled lower than threshold, for example hide fixed header
var t_sticky = {
monitor: function() {
if( !this.waiting ) {
setTimeout( this.check.bind(this), 250 );
this.waiting = true;
}
},
check: function() {
var val = this.$html.scrollTop() > this.at ? 0 : 1;
if( this.is_on != val ) {
@tairli
tairli / tabbed-description.liquid
Last active February 13, 2023 08:04
Tabbed description code for Shopify. "Slice" your description with <H6> elements (which will serve as tab titles) and stop with <H5> element.
{% comment %}
if combine_pretext is false, the text before the first <h6> will be shown above all tabs, otherwise added to the first tab
if stop_on_h5 is true, tabs parsing will stop on first H5 element and the rest will be shown below tabs.
What's inside H5 is discarded, but still put something meneningfull there, just in case you switch theme or alike.
No multiple H5 elements.
{% endcomment %}
{% assign combine_pretext = false %}
{% assign stop_on_h5 = true %}