iTimeTraveler / hexo-theme-hipaper

A fashional newspaper theme for Hexo.
https://itimetraveler.github.io/hexo-theme-hipaper/
MIT License
249 stars 77 forks source link

headerblur - cannot read property 'style' of null #6

Closed luibab closed 7 years ago

luibab commented 7 years ago

Hello,

Looking at the devtools in chrome I've noticed the uncaught TypeError mentioned in the title gets thrown. It appears that the following piece of code located at _partial/footer triggers the error:

<!-- headerblur min height -->
    var headerblur = document.getElementById("header-blur");
    headerblur.style.minHeight = window.getComputedStyle(document.getElementById("allheader"), null).height;

I wonder if it would be safe to remove that code snippet from _partial/footer in order to prevent the error to appear in the devtools console. It seems that there is no html element with id #header-blur, hence the error.

iTimeTraveler commented 7 years ago

Hi, @llbarril Sorry, I find it's a bug just now. and I have fixed it. You can just use git pull to update code and check it.

This code snippet will set min height for the big blur image in About Page, like this. It just should have effect in About Page, but I made a mistake in forgetting to fliter these pages.

luibab commented 7 years ago

Updated. No errors in the console now. Thanks!