我有一个html格式的动态表。我可以通过下面的函数得到我的表行。
HTML:
<tr ng-click="heightChecker(this)" ng-repeat='DFC in DetailsOfFloorsCurrent'<td>blahblah</td></tr>脚本:
$scope.heightChecker = function (row) {
alert(row.$index-2);
}我想要从我的页面顶部获得我的行高。我可以得到我的行,但我不能从我的页面顶部获得以像素为单位的高度。有什么办法吗?(注意:我的表是动态的,有n行n列。)
发布于 2015-09-26 20:18:58
您可以使用jquery offset()
$('row').offset().top利用这一点,你可以得到与顶部的距离。
https://stackoverflow.com/questions/32796786
复制相似问题