Skip to content

Instantly share code, notes, and snippets.

View hkxnyc's full-sized avatar

Hannah hkxnyc

  • San Francisco, CA
View GitHub Profile
@hkxnyc
hkxnyc / bx.js
Last active August 29, 2015 14:07
an overlay that triggers when scroll hits bottom 10% of any page on the warbyparker.com site with option to close overlay
(function(){
var cartTotal = 0,
cartQuantity = 0,
overlayPicture;
//initialize when scroll is 90% or over of the document height.
var Cart = {
init: function() {
$(window).scroll(function(){
if ($(this).scrollTop() >= ($(document).height() - ($(this).height()))){