How to scroll HTML page to given anchor?

后端 未结 17 1961
醉梦人生
醉梦人生 2020-11-22 08:55

I’d like to make the browser to scroll the page to a given anchor, just by using JavaScript.

I have specified a name or id attribute in my

17条回答
  •  耶瑟儿~
    2020-11-22 09:25

    This is a working script that will scroll the page to the anchor. To setup just give the anchor link an id that matches the name attribute of the anchor that you want to scroll to.

    
    

提交回复
热议问题