zenscroll
zenscroll copied to clipboard
True zen recognizes the relativity in all things
Hey, great package! Recently noticed an issue where zenscroll will not successfully scroll to any element contained in a position: relative
div.
Demo here: http://requirebin.com/?gist=ae3708359c2ad71651d03fb9bdfc9115
In it, you will see three buttons. The second one will not work because div b
is contained inside a div with position: relative
, and will instead scroll to the top of the container div.
Thank you very much for reporting it, especially that you prepared an example. I am looking into it.
Great subject by the way! :)
Its because the library is made to use elem.offsetTop. But you should change it to walk up the given element's parents until it reaches the zenscroll container. Is the fix planned any time soon?
You are right, and sorry about that. I was hoping that eventually all major browsers implement smooth scrolling, which is preferred over a custom JavaScript solution. Fortunately, this has happened since then.