javascript - Ionic Scroll to Element -
i have with:
<span id="quote-{{quote.id}}" ng-repeat="quote in quotes">{{quote.text}}</span>
i'm trying have index scroll part of scroller using:
$scope.jumptoquote = function (quote) { $scope.quoteselected = quote; var quoteposition = $ionicposition.position(angular.element(document.getelementbyid('quote-'+quote))); $ionicscrolldelegate.$getbyhandle('quotes-box').scrollto(quoteposition.left, quoteposition.top, true); }
however value of quoteposition.top equals 10 top-offset of <ion-scroll>
.
as far see, need replace document.getelementbyid('quote-'+quote)
document.getelementbyid('quote-'+quote.id)
, concatenating whole quote
object instead of it's id
.
Comments
Post a Comment