源碼是:
滑動效果:

jQuery("#topHeaderBlack").anmate({scrollLeft:jQuery("#"+NowfloorUuid).offset().left},1000);
topHeaderBlack 是包含了ul li 的div id
jQuery("#"+NowfloorUuid) 是你需要錨點的li
我是通過下面代碼變形達到效果(畢竟前端渣、見笑、)

$(“html,body”).animate({scrollTop:$(“#box”).offset().top},1000)
首先要知道 jQuery的 animate 的方法的使用
參考: http://www.w3school.com.cn/jquery/effect_animate.asp
其次 jQuery錨點跳轉及相關操作(轉)
$(“html,body”).animate({scrollTop:$(“#box”).offset().top},1000)
參考: http://ygsilence.iteye.com/blog/1699906
現在的項目需求是
<ul>中有很多的<li> 並且通過css 是是現在了橫向的處理 當li過多的時候 就會出現滾動的需求、
那么當你點擊過一次某<li>后 再次進入該界面時候 需要將頁面定位到該<li>上 那么就需要一個錨點的設置
一開始使用的方法是最原始的錨點
即:
1、location.href = "#firstAnchor"; // firstAnchor為錨點名稱
2、window.location.hash = firstAnchor; // firstAnchor為錨點名稱
當然還有最原始的點擊事件