Line 10: | Line 10: | ||
<head> | <head> | ||
<style type="text/css"> | <style type="text/css"> | ||
− | .parallax{ | + | |
+ | .low-res-parallax{ | ||
background-image: url("https://static.igem.org/mediawiki/2018/d/dd/T--Uppsala--TeamPictureLow.jpg"); | background-image: url("https://static.igem.org/mediawiki/2018/d/dd/T--Uppsala--TeamPictureLow.jpg"); | ||
} | } | ||
Line 17: | Line 18: | ||
<div class="body"> | <div class="body"> | ||
− | <div class="parallax" data-src="https://static.igem.org/mediawiki/2018/1/12/T--Uppsala--TeamPicture.jpg"></div> | + | <div class="parallax low-res-parallax" data-src="https://static.igem.org/mediawiki/2018/1/12/T--Uppsala--TeamPicture.jpg"></div> |
<div class="igem-icon"><a href="https://2018.igem.org/Main_Page"><img src="https://static.igem.org/mediawiki/2018/b/b0/T--Uppsala--graylogo.png"></a></div> | <div class="igem-icon"><a href="https://2018.igem.org/Main_Page"><img src="https://static.igem.org/mediawiki/2018/b/b0/T--Uppsala--graylogo.png"></a></div> | ||
Line 162: | Line 163: | ||
'use strict'; | 'use strict'; | ||
// Page is loaded | // Page is loaded | ||
− | const objects = document.getElementsByClassName('parallax'); | + | const objects = document.getElementsByClassName('low-res-parallax'); |
Array.from(objects).map((item) => { | Array.from(objects).map((item) => { | ||
// Start loading image | // Start loading image | ||
Line 170: | Line 171: | ||
img.onload = () => { | img.onload = () => { | ||
− | item.classList.remove('parallax'); | + | item.classList.remove('low-res-parallax'); |
return item.nodeName === 'IMG' ? | return item.nodeName === 'IMG' ? | ||
item.src = item.dataset.src : | item.src = item.dataset.src : |
Revision as of 15:16, 14 October 2018