From 398fa3e9277c14207bdb501e9dd530b8d2c3f7d1 Mon Sep 17 00:00:00 2001 From: Mike Date: Thu, 9 Jul 2015 09:02:17 -0500 Subject: [PATCH] Removed redundant jQuery selector When inside of the $('.clothes-pics figure').each loop, you can use $(this) to grab the current item. No need to do another query using $('.clothes-pics figure').eq(i). --- js/functions.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/functions.js b/js/functions.js index f20002f..6a0939f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -25,9 +25,9 @@ $(window).scroll(function(){ if(wScroll > $('.clothes-pics').offset().top - ($(window).height() / 1.2)) { $('.clothes-pics figure').each(function(i){ - + var figure = $(this); setTimeout(function(){ - $('.clothes-pics figure').eq(i).addClass('is-showing'); + figure.addClass('is-showing'); }, (700 * (Math.exp(i * 0.14))) - 700); });