Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/themefisher/kross-hugo-portfolio-template.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMehedi Sharif Titas <mehedishariftitas@gmail.com>2019-11-10 13:36:10 +0300
committerGitHub <noreply@github.com>2019-11-10 13:36:10 +0300
commit1f239d2a1833d1457e1c5fcceb5820bbd68f933c (patch)
treef43731479638e6bc3afd6a1bc42e95d479d34e2c
parenta3cb39169383b2515533806b38a3b5f2185b0419 (diff)
parent6f4b1ce282ac79410cf7e1e426adba97c79f32d9 (diff)
Merge pull request #7 from woniuxingdong/master
fix js error when not in the home page
-rw-r--r--assets/js/script.js11
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);