JS
var id = "#companyName" + $scope.CN;
$("html, body").animate({scrollTop: $(id).offset().top - 100}, {duration: 500, easing: "swing"});
HTML
<div id="companyName{{ranking.riskCode}}" ng-repeat="ranking in rankings">
<div class="pad2">
<div class="bxj-tit f4">{{ranking.riskCompany}}</div>
<div class="c5 f2">标保单位:万元</div>
<table class="bxj-table c5">
<tr>
<th>排 名</th><th>省级平台</th><th>代理人姓名</th><th>标 保</th>
</tr>
<tr ng-repeat="standard in ranking.standardPersonList">
<td>{{standard.ranking}}</td>
<td>{{standard.province}}</td>
<td>{{standard.agentname}}</td>
<td>{{standard.standard}}</td>
</tr>
</table>
</div>
</div>