首页 > 语言 > JavaScript > 正文

jQuery aminate方法定位到页面具体位置

2024-05-06 14:38:12
字体:
来源:转载
供稿:网友
通过jQuery的aminate动画方法定位。

示例如下:
代码如下:
scrollOffset($("#qa").offset());

// jQuery 定位让body的scrollTop等于pos的top,就实现了滚动
function scrollOffset(scroll_offset) {
$("body,html").animate({
scrollTop: scroll_offset.top - 70
}, 0);
}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选