核心提示:实现定位锚点返回相应位置的两种方式/*var target_top = $(#btm).offset().top;*/ //获得#btm当前顶部的垂直偏移量(便于等位到当前位置)1. //$(html...
实现定位锚点返回相应位置的两种方式
/*var target_top = $("#btm").offset().top;*/ //获得#btm当前顶部的垂直偏移量(便于等位到当前位置)
1. //$("html,body").animate({scrollTop: target_top}, 1000); //带滑动效果的跳转
2. /*$("html,body").scrollTop(target_top);*/