0

for a custom scrollbar script I want to override the default scrolltop property. Now I have the problem, that I need to reach the value first to modify it. I use

Object.defineProperty(
    document.documentElement,
    "scrollTop",
    {
        get: function() {
            // How to get the scrollTop value here???
        }
    }
);

to do the job. Has anyone an idea or alternative?

best regards,

Simon

Simon
  • 26
  • 4
  • You want to replace the scrollTop property but still have access to it? – Naman Nehra Mar 18 '16 at 10:47
  • Yes, i want to get the Value, modify it and then return it. – Simon Mar 18 '16 at 15:36
  • I don't think it's possible. I have still tried to search for it and check it it's possible with es6 proxy. I couldn't find any way to do it and believe it's not possible. If need a property then don't overwrite it and name your defined property something else. – Naman Nehra Mar 18 '16 at 16:16

0 Answers0