Skip to content

Commit e76e0a9

Browse files
committed
scale bar with browser resize
1 parent 361b032 commit e76e0a9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/progress.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@
122122
//set progress bar container size and offset
123123
progressElementContainer.style.left = targetElementOffset.left + 'px';
124124
progressElementContainer.style.top = targetElementOffset.top + 'px';
125-
progressElementContainer.style.width = targetElementOffset.width + 'px';
125+
//if targetElement is body set to percent so it scales with browser resize
126+
if (targetElement.nodeName == 'BODY') {
127+
progressElementContainer.style.width = '100%';
128+
} else {
129+
progressElementContainer.style.width = targetElementOffset.width + 'px';
130+
}
126131

127132
if (this._options.overlayMode) {
128133
progressElementContainer.style.height = targetElementOffset.height + 'px';

0 commit comments

Comments
 (0)