From 8d0ea7000ecb7780d566871189ffe2270c6671fd Mon Sep 17 00:00:00 2001 From: LorenzoFrediani-Laser Date: Thu, 2 May 2019 23:45:31 +0200 Subject: [PATCH] Add ability to scalize more images on same page .each() syntax to add ability to scalize more images on same page --- js/scalize.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/js/scalize.js b/js/scalize.js index 95a6836..ce8058b 100644 --- a/js/scalize.js +++ b/js/scalize.js @@ -1,6 +1,6 @@ (function($) { "use strict"; - + $.fn.scalize = function(options){ //----------------------------------------// // Variable //----------------------------------------// @@ -190,8 +190,9 @@ //----------------------------------------// // Scalize Plugin //----------------------------------------// - $.fn.scalize = function(options){ - return scaling.init(this, options); - }; - +return this.each(function(){ + var $this = $(this); + scaling.init($this, options); + }); + }; }(jQuery)); \ No newline at end of file