var left = 22; var right = 22; var lowTemperature = 15; var hiTemperature = 30; var temperatures = []; var isScrolling; var elementHeight; function createTemperatureElement() { var element = document.createElement('div'); element.classList = ['temperature']; element.style.height = elementHeight+'px'; element.style.lineHeight = elementHeight+'px'; return element; } function update(node, index) { node.scrollTop = index*elementHeight; for( var i=0; i