jQuery aminate方法定位到页面具体位置
摘要:通过jQuery的aminate动画方法定位。示例如下:复制代码代码如下:scrollOffset($("#qa").offset());/...
通过jQuery的aminate动画方法定位。
示例如下:
复制代码 代码如下:
scrollOffset($("#qa").offset());
// jQuery 定位让body的scrollTop等于pos的top,就实现了滚动
function scrollOffset(scroll_offset) {
$("body,html").animate({
scrollTop: scroll_offset.top - 70
}, 0);
}
【jQuery aminate方法定位到页面具体位置】相关文章:
★ JQuery中attr方法和removeAttr方法用法实例
★ 介绍JavaScript中Math.abs()方法的使用