From 93d937fafa5c998eb244606e626f964a6ac4674d Mon Sep 17 00:00:00 2001 From: Equan Simmonds Date: Fri, 5 Oct 2012 16:17:30 -0400 Subject: [PATCH] Correcting issue when value is greater than max --- progress-polyfill.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/progress-polyfill.js b/progress-polyfill.js index 9cbb97b..e9abd41 100644 --- a/progress-polyfill.js +++ b/progress-polyfill.js @@ -157,9 +157,13 @@ var self = window.ProgressPolyfill = { } } - if(progress.position !== -1) { - progress.style.paddingRight = progress.offsetWidth * (1-progress.position) + 'px'; - } + if (progress.position !== -1) { + var position = 1 - progress.position; + if (position < 0) { + position = 0; + } + progress.style.paddingRight = progress.offsetWidth * (position) + 'px'; + } }, isInited: function(progress) {