Skip to content

Instantly share code, notes, and snippets.

@Fastest17
Fastest17 / img_to_background.js
Last active November 2, 2022 20:52
JQuery - Img to Background
function changeImgToBg(imgSel, parentSel) {
if (!imgSel) {
console.info('no img selector');
return false;
}
let $parent,
_this;
$(imgSel)
@Fastest17
Fastest17 / hover.js
Last active November 2, 2022 20:53
JQuery - Hover
$(“.sale-menu”).hover(function () {
$(‘.sale-sub-menu’).fadeIn(500);
}, function(){
$(“.sale-sub-menu”).hide();
});
$(“.sale-sub-menu”).hover(function () {
$(‘.sale-sub-menu’).show();
}, function(){
$(“.sale-sub-menu”).fadeOut(500);
});
@Fastest17
Fastest17 / BreadCrumbs.liquid
Last active November 2, 2022 20:53
Shopify - BreadCrumbs
{% assign menu = colections-menu %}
{% assign menu-link = colections-menu-link %}
<nav class=“breadcrumb” role=“navigation” aria-label=“breadcrumbs”>
<a href=“/” title=“Home”>Home</a>
<a href=“{{ menu-link }}“>> {{ menu.title }} </a>
{% for link in menu.links %}
{% if link.active or link.child_active %}
<a href=“{{link.url}}“> > {{ link.title }}</a>
{% endif %}
{% for sub_link in link.links %}
@Fastest17
Fastest17 / nav_sub_menu.liquid
Last active November 2, 2022 20:54
Shopfy - Nav sub menu
<ul class=“cd-accordion-menu custom-colections”>
{% assign num = 1 %}
{% assign num_2 = 1 %}
{% for link in colections-menu.links %}
{% assign has_sub_menu = false %}
{% assign has_sub_link = false %}
{% for sublink in link.links %}
{% if sublink.levels > 0 %}
{% assign has_sub_menu = true %}
@Fastest17
Fastest17 / MixitUp.js
Last active November 2, 2022 20:55
jQuery - MixitUp Filter
$(function () {
$('.toggles button').click(function(){
var get_id = this.id;
var get_current = $('.posts .' + get_id);
$('.post').not(get_current).hide(500);
get_current.show(500);
});
$('#showall').click(function(){
@Fastest17
Fastest17 / custom_posts.liquid
Last active November 2, 2022 20:56
Shopify - Custom Posts
<div id="related-articles">
<h3>Related Blog Posts</h3>
{% assign articlesFound = 0 %}
{% for article in blogs.living-orange-blog.articles %}
{% if article.tags contains collection.title %}
<div class="related-article">
{% if article.image %}
<div class="article-image-box">
<a href="{{ article.url }}">
@Fastest17
Fastest17 / collections.liquid
Last active November 2, 2022 20:57
Shopify - collections
<div class="brands-sub-menu">
<div class="brands-sub-menu-wrapper">
{% for link in linklists.brands.links limit:18 %}
{% assign collection = link.object %}
<div class="brands-sub-menu-item">
<a href="{{ link.url }}" class="">
{% if collection.image %}
<img src="{{ collection | img_url: image_size }}" alt="{{ link.title | escape }}">
{% else %}
@Fastest17
Fastest17 / post_filter.js
Last active November 2, 2022 20:58
jQuery - Post Filter
/* ============================ */
/* POST FILTER */
/* ============================ */
$('.post-filter__header li').on('click', function () {
$('.post-filter__header li').removeClass('active');
$(this).addClass('active');
});
@Fastest17
Fastest17 / active_nav_menu.js
Last active November 2, 2022 21:00
jQuery - Active nav menu
$("ul a")
.click(function (e) {
var link = $(this);
var item = link.parent("li");
if (item.hasClass("active")) {
item.removeClass("active").children("a").removeClass("active");
} else {
item.addClass("active").children("a").addClass("active");
@Fastest17
Fastest17 / Google_Maps.js
Last active November 2, 2022 21:01
Google Maps
// Initialize and add the map
function initMap() {
var brooklyn = {lat: 41.893927, lng: -87.640367};
var icon_marker = {
url: "./assets/images/location-02.png",
origin: new google.maps.Point(0, 0),
size: new google.maps.Size(17, 23),
scaledSize: new google.maps.Size(17, 23),
}
// The location of Uluru