From 09e97fa08b42085a80cea8ced750a7edb61a6f6d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 23 Apr 2011 00:46:37 +0200 Subject: [PATCH] images is not an array use Ox.forEach --- source/js/Ox.Flipbook.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/source/js/Ox.Flipbook.js b/source/js/Ox.Flipbook.js index dd90d7e2..13e9e452 100644 --- a/source/js/Ox.Flipbook.js +++ b/source/js/Ox.Flipbook.js @@ -18,14 +18,14 @@ Ox.Flipbook = function(options, self) { timestamp = $('
').css({ 'position': 'absolute', 'text-align': 'center', - 'width': '100%', + 'width': '100%' }) .hide(), that = new Ox.Element('div', self) .defaults({ frames: {}, duration: 0, - icon: '', + icon: '' }) .options(options || {}) .append(icon) @@ -66,9 +66,10 @@ Ox.Flipbook = function(options, self) { function getFrame(position) { var frame; - frames.forEach(function(img, i) { - if (!frame || i <= position) + Ox.forEach(frames, function(img, i) { + if (!frame || i <= position) { frame = img; + } }); return frame; } @@ -78,7 +79,7 @@ Ox.Flipbook = function(options, self) { frames[i] = new Image(); frames[i].onload = function() { frameHeight = frames[i].height / frames[i].width * that.width(); - } + }; frames[i].src = src; }); } @@ -89,10 +90,11 @@ Ox.Flipbook = function(options, self) { } else if (key == 'icon') { icon.attr('src', value); } - } + }; - if(options.icon) - icon.attr('src', options.icon); + if(options.icon) { + icon.attr('src', options.icon); + } cacheFrames(); return that; };