How do you override scroll functions of a browser in JavaScript?
Functions which I was able to find are scroll
, scrollBy
and scrollTo
(from the window
object).
But, if I try to override them using the standard procedure, like any other function, for example, by executing the following code window.scroll = function(parameter){}
it does not have any effect on the browser.
So, if I try to scroll the page after executing the above code (for all 3 methods), the window still scrolls.
Are there any other functions which browser uses to scroll? If so, which function should I override to get a custom scrolling behaviour?
I am using Google Chrome (latest version), of course.