1

I have a dynamic Table in html. I can get my table row by below function.

HTML:

<tr ng-click="heightChecker(this)" ng-repeat='DFC in DetailsOfFloorsCurrent'<td>blahblah</td></tr>

Script:

$scope.heightChecker = function (row) {
    alert(row.$index-2);
}

I want to get my row height, from top of my page. I can get my row, but I can't get the height in pixel from top of my page. Is there any way? (attention: My table is dynamic with n row and n column.)

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Mehran
  • 323
  • 1
  • 11

1 Answers1

0

You can use jquery offset():

$('row').offset().top

Using that you get the distance from the top.

Erveron
  • 1,908
  • 2
  • 25
  • 48
  • Im not using JQUERY & i have no idea about how to use it. If there is any way to using angularjs or javascript, i will be thanksful. – Mehran Sep 26 '15 at 14:22
  • 1
    http://stackoverflow.com/questions/18953144/how-do-i-get-the-offset-top-value-of-an-element-without-using-jquery There is another post asking how to get the offset top, without using jQuery. There they use angular or javascript. I think there you can find the answer to your comment. Hope it's helpful! – N. Soberon Sep 27 '15 at 23:35