From 3d3987e7bda1bc8c7837e98ef8907faa0bdc25ac Mon Sep 17 00:00:00 2001 From: Viljami S Date: Sun, 4 Dec 2011 14:30:53 +0200 Subject: [PATCH] Move variables around + Change while loop to each(); --- adaptiveslides.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/adaptiveslides.js b/adaptiveslides.js index 88e0ad3..fd4dcc3 100644 --- a/adaptiveslides.js +++ b/adaptiveslides.js @@ -24,14 +24,16 @@ } var slideshow = function () { - $this.find('img').each(function (i) { + var $slides = $this.find('img'); + + $slides.each(function (i) { var $el = $(this); $el.attr({ id : settings.namespace + '_slide' + i }); }); - $this.find('img').css({ + $slides.css({ top: 0, left: 0, width: '100%', @@ -71,25 +73,23 @@ // Auto: false } else { - var $pagination = $('