Skip to content

Commit

Permalink
Resize optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Feb 18, 2015
1 parent 057eb3e commit c126d61
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/skrollr.decks.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,14 @@
// Update decks size
function resizeDecks() {
var wndHeight = window.innerHeight + 2,
deck, deckHeight, key;
for(key in segments) if(segments.hasOwnProperty(key)) {
deck = segments[key];
deck, deckHeight, i;
for(i = segmentsList.length - 1; i > -1; i--) {
deck = segmentsList[i];
deck.style.height = 'auto';
deckHeight = deck.offsetHeight;
deck.style.height = (deckHeight < wndHeight ? wndHeight : deckHeight) + 'px';
}
deck.offsetHeight;
}


Expand Down

0 comments on commit c126d61

Please sign in to comment.