阅读背景:

使用switch语句从另一个页面滚动到锚点

来源:互联网 

I am having trouble getting my script to do any scroll actions for some reason. I am using a switch statement to determine which link was clicked (the link is on my nav, so you are coming from another page entirely), then I want to have the page scrolled to the top of the page (and eventually scroll smoothly down to the anchor again). For some reason my console log statement is firing but the page is not scrolling to the top. When I type window.scrollTo(0, 0); into the console though the page scrolls up...here is my script, any help is appreciated.I am having trouble getting my script to do any




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: