教程集 www.jiaochengji.com
教程集 >  jQuery  >  jquery 教程  >  正文 jQuery animate方法定位页面具体位置(示例)

jQuery animate方法定位页面具体位置(示例)

发布时间:2015-11-28   编辑:jiaochengji.com
本文介绍下,在jquery中使用aminate方法定位页面的具体位置的例子,有需要的朋友可以参考学习下。

jquery实现定位到页面具体位置,通过jQuery的animate动画方法定位。
 
例子,通过jQuery的animate动画方法定位。
 

复制代码 代码示例:

scrollOffset($("#qa").offset());

// jQuery 定位让body的scrollTop等于pos的top,实现滚动
function scrollOffset(scroll_offset) {
$("body,html").animate({
scrollTop: scroll_offset.top - 70
}, 0);
}

您可能感兴趣的文章:
jQuery animate方法定位页面具体位置(示例)
jQuery aminate方法定位到页面具体位置
jQuery动画效果animate和scrollTop结合使用实例
JQuery 动画卷页 返回顶部 动画特效(兼容Chrome)
jquery animate动画方法使用介绍
jquery animate动画函数用法浅析
jQuery动画animate方法实例分享
Jquery 自定义动画概述及示例
jQuery动画animate方法使用介绍
jQuery Animation实现CSS3动画示例介绍

关键词: animate  定位  动画   
[关闭]
~ ~