Home  >  Article  >  Web Front-end  >  jquery page scrolls to the specified DIV implementation code_jquery

jquery page scrolls to the specified DIV implementation code_jquery

WBOY
WBOYOriginal
2016-05-16 17:21:30965browse

The parameter id is the page element id

Copy code The code is as follows:

function mScroll(id){ $("html,body").stop(true);$("html,body").animate({scrollTop: $("#" id).offset().top}, 1000);}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn