somewebmedia / hc-sticky

JavaScript library that makes any element on your page visible while you scroll.
https://somewebmedia.github.io/hc-sticky/
MIT License
462 stars 114 forks source link

Fix IE 8 complains for instanceof on non-function #1

Closed lambacck closed 10 years ago

lambacck commented 10 years ago

IE 8 expects the left side of an instanceof expression to be a function. Since stickTo could be a string. Protect against that case and also create a flag for later checks.

somewebmedia commented 10 years ago

Thanks @lambacck for pointing that out, I kept my approach for short-hand statements and also found an IE9 bug. IE9 don't recognize HTMLDocument but Document instead.