View Single Post
Old 02-23-2015, 11:28 AM   #5
bowlins
Member
bowlins began at the beginning.
 
Posts: 18
Karma: 10
Join Date: Jul 2014
Device: none
Glad to know that there's a way but after too many hours trying I'm unable to put it in place.

Because I can't print variables on console I don't know which position (if any) my functions are returning. I've tried many variations of offsetParent and offsetTop but with no visible results.

However, the most logical option to me would be to use a variation of my previous answer:

Code:
if (document.getElementsByClassName("chapter").getBoundingClientRect()  != null ||
    document.getElementsByClassName("chapter").getBoundingClientRect() != 'undefined') {
//Code to hide header
}
There doesn't seem to be any errors when I run this as the rest of the script runs as it should. But without a console I don't know what value getBoundingClientRect() (or even getBoundingClientRect().top) is actually returning.

Would this be a correct method? Or how could I check returned values?
bowlins is offline   Reply With Quote