From 406c2322d4413ecaabd5fc6592742da4da5bdc80 Mon Sep 17 00:00:00 2001 From: Oliver Caldwell Date: Fri, 1 Apr 2011 21:33:15 +0100 Subject: [PATCH] Used the typeof operator to check for the offset variable --- src/toggle.js | 2 +- src/transition.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/toggle.js b/src/toggle.js index a3f8f5c..7f1761b 100644 --- a/src/toggle.js +++ b/src/toggle.js @@ -27,7 +27,7 @@ SparkFn.toggle = function(method, timeframe, easing, callback) { } // Initiate the offset as 0 if there is none - if(!this.offset) { + if(typeof this.offset === 'undefined') { this.offset = 0; } diff --git a/src/transition.js b/src/transition.js index 54d6abc..980b000 100644 --- a/src/transition.js +++ b/src/transition.js @@ -20,7 +20,7 @@ SparkFn.transition = function(method, timeframe, easing, callback) { } // Initiate the offset as 0 if there is none - if(!this.offset) { + if(typeof this.offset === 'undefined') { this.offset = 0; }