简体   繁体   中英

Google ads javascript moving page scroll to top

In my web page google ads are present and in the url hash tag is present . Initially when page loads it scrolls to that DIV having id equal to url hash tag then google ads are loaded which moves the page to top. How I can fix the problem of page getting scrolled to top.

Finally I figured out Google ads was not the issue instead other third party javascript was the main issue behind it. I overrided scrollTo function in global object window as soon as the page loaded with mentioned script below. Due to which I was able to figure the root cause of the problem.

window.scrollTo = function(){
    console.log("Overriding started");
    debugger;
    console.log("Overriding end");
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM