比如我現在 a.html 的時候,我想跳轉到 b.html ,並且是 b.html 的某一個位置,用 <a href=>,
a.html里:
<a href="b.html#abc">xxx</a>
b.html里加一個錨記:
<a name="abc"></a>
JQuery方法
$("html,body").animate({scrollTop:$("#${nameMao}").offset().top},1000);
比如我現在 a.html 的時候,我想跳轉到 b.html ,並且是 b.html 的某一個位置,用 <a href=>,
a.html里:
<a href="b.html#abc">xxx</a>
b.html里加一個錨記:
<a name="abc"></a>
JQuery方法
$("html,body").animate({scrollTop:$("#${nameMao}").offset().top},1000);
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。