Hi all,
Trying to write a directive that watches its element's position as it
animates (right now via JS - TweenMax)
For example - tracking the offset of a scrollview during a momentum
animation:
// Get scroll offset:
var getOffset = function () {
return scrollViewEl.offset();
}
// Watch scroll offset:
scope.$watch(getOffset, function(value) {
console.log('scrollview offset changed.');
}, true);
Right now I can only get this to work if I $scope.$apply() inside of the
TweenMax onUpdate callback:
var animUpdate = function () {
$scope.$apply();
};
TweenMax.to(_scrollView, sec, {top: newY, ease:'Power4.easeOut',
onUpdate:animUpdate});
This implementation smells a little bit. Any ideas for a better way to
watch the element's offset?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.