diff options
author | spencer <spencer.shou@gmail.com> | 2019-11-10 06:19:21 +0300 |
---|---|---|
committer | spencer <spencer.shou@gmail.com> | 2019-11-10 06:19:21 +0300 |
commit | 6f4b1ce282ac79410cf7e1e426adba97c79f32d9 (patch) | |
tree | 51b402dc93d6c8da386dc62aef1810e6e674dd54 /assets | |
parent | b95c7adbf0e3ecee17f61936a4b9313f8054193e (diff) |
fix js error when not in the home page
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/script.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/assets/js/script.js b/assets/js/script.js index 9b8fb52..ff3101e 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -43,6 +43,15 @@ window.onload = function () { var parallaxBox = document.getElementById('parallax'); + /* + Fix js error, occurred at pages other than the home page. + When there're no parallax, just ignore the below + other operations, as below elements are bingding to the parallax. + */ + if (!parallaxBox) { + return ; + } + var /* c1left = document.getElementById('l1').offsetLeft, c1top = document.getElementById('l1').offsetTop, */ @@ -160,4 +169,4 @@ -})(jQuery);
\ No newline at end of file +})(jQuery); |