Doing tests through Firebug/Firefox, I’m attempting to run the simplest of commands to have the page scroll to the bottom using the following command:
window.scrollBy(0,3000);
Simple, right? Doing a test on a couple websites, for example Yahoo.com, the small line of code works perfectly. However, on one specific site that I’m attempting to run this on, the page does not scroll I get this in my console log.
>>> window.scrollBy(0,3000);
undefined
The page I’m testing automatically has jQuery 1.7.2 running on it. What could I send through my console to fix this error? I’m suspecting to ‘define window’ again?
window.scrollByisn’t working on the page you are trying it on, because it’s not window that’s overflowed and is scrolling.The
c_basediv on the page is what’s being scrolled. It’s absolutely positioned, and its overflow is what you are scrolling, not the entire window.You can scroll the div by setting it’s
scrollTopproperty: