diff options
Diffstat (limited to 'template/script.js')
| -rwxr-xr-x | template/script.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/template/script.js b/template/script.js index e8b7039..ad98600 100755 --- a/template/script.js +++ b/template/script.js | |||
| @@ -14,11 +14,14 @@ window.addEventListener('load', () => { | |||
| 14 | }); | 14 | }); |
| 15 | 15 | ||
| 16 | // flip CV image on mouse over | 16 | // flip CV image on mouse over |
| 17 | document.querySelector('.cv-picture img').addEventListener('mouseover', evt => { | 17 | const cvImage = document.querySelector('.cv-picture img'); |
| 18 | evt.target.style.transform = 'scaleX(-1)'; | 18 | if (cvImage) { |
| 19 | }); | 19 | cvImage.addEventListener('mouseover', evt => { |
| 20 | evt.target.style.transform = 'scaleX(-1)'; | ||
| 21 | }); | ||
| 20 | 22 | ||
| 21 | document.querySelector('.cv-picture img').addEventListener('mouseout', evt => { | 23 | cvImage.addEventListener('mouseout', evt => { |
| 22 | evt.target.style.transform = 'scaleX(1)'; | 24 | evt.target.style.transform = 'scaleX(1)'; |
| 23 | }); | 25 | }); |
| 26 | } | ||
| 24 | }); | 27 | }); |
