This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var fLazy = (function(doc){ | |
return { "init" : function( _bMobl ){ | |
var _aE = [].slice.call( doc.querySelectorAll( "[data-lz-src]" ) ); | |
_aE.filter( function( _e ){ | |
if( _bMobl ){ // isMobile | |
if( _e.dataset.lzM ){ // data-lz-m | |
_e.src = _e.dataset.lzSrc; | |
} | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 20160601 Scott C. Krause | |
# Remove files that exist within out from the in folder | |
# This Windows PowerShell script takes an inventory of one folder and for each file that exists will execute a delete in another folder. | |
# I wrote this to deal with some bizarre node/gulp race conditions while doing image optimization. | |
# So if a file has been processed (compressed) it is ok to delete it from the images_in folder. | |
$dest = "\\compressed" | |
$source = "\\images_product\images_in" | |
$in = Get-ChildItem $source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add and Remove a class repeatedly for a set duration for a set number of times (blinking or animating). | |
// This is good for blinking an element for a few seconds to attract attention to it. | |
var fBlinkClass = function( _sQuery, _sClass, _nItra, _nDura ){ | |
var eChevr = document.querySelector( _sQuery ), _nCur = 0, _si; | |
eChevr.classList.add( _sClass ); | |
_si = window.setInterval(function(){ | |
if( ++_nCur <= _nItra ){ | |
if( eChevr.classList.contains( _sClass ) ){ | |
eChevr.classList.remove( _sClass ); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lightweight ZF Equalizer alternative | |
// Will make two or more HTML elements the same height | |
// Usage: eq2.makeEqual("[data-equalizer-watch='your_pattern']"); | |
var eq2 = { | |
Mx: 0, | |
makeEqual: function( data_eqlzr_watch ){ | |
$( data_eqlzr_watch ).each(function(){ | |
eq2.Mx = ( this.clientHeight > eq2.Mx ) ? this.clientHeight : eq2.Mx; | |
}); | |
$( data_eqlzr_watch ).css("height", eq2.Mx + "px"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function canIUseWebP() { // Original Author Unknown | |
var elem = document.createElement('canvas'); | |
if (!!(elem.getContext && elem.getContext('2d'))) { | |
return elem.toDataURL('image/webp').indexOf('webp') == 0; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){var a=Math.floor(((new Date).getTime()+1112009)/864E5),b=window,c=b.document,d="https://marketer.monetate.net/control/inspector/"+a+"/",e=b.__mti&&b.__mti.open;if(e)e();else if(!c.getElementById("mtInspector-script")){var f=c.getElementsByTagName("head")[0]||c.body;if(f){var g=f,h=d,i=c.createElement("link");i.href=h+"inspector.css";i.rel="stylesheet";g.insertBefore(i,g.firstChild);var j=f,k=d,l=c.createElement("script");l.src=k+"inspector.js";l.id="mtInspector-script";j.insertBefore(l,j.firstChild)}};})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Infinite Scroll ⚡️ Scott C. Krause</title> | |
<style> | |
/* -------------------- | |
Add your styling here | |
-------------------- */ | |
.container { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>QQQQ | emoji</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
html, body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var labelMD_default = { // Detault configuration | |
mode: "default", | |
aExcludeID: ["js-qty__input--id","js-inp-search--id","js-toplogo-slide__input--id","js-inp-topsearch--id","quickSearch-query-for-small","emailSubscribeAddressModal","emailAddressFieldId","quickSearch-query"], | |
aExcludeCL: ["js-eml__input--field", "js-sms__input"] | |
}; | |
//var labelMD_custom = { mode: "custom" } // Custom configuration | |
var labelMD = ( function( _d, _g ){ // Dynamic Material Design INPUT Labels | |
var aInp = [], aLab = [], oCnf = {}, sBrand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; // Act on Tab when link clicked | |
var oTb, oLk; | |
oTb = document.querySelectorAll(".tablink4")[0]; | |
oLk = document.querySelectorAll("[href='/#tablink4']")[0]; | |
if( oTb && oLk ){ | |
oLk.addEventListener( "click", function(e){ | |
oTb.click(); | |
} ); | |
} |