javascript - Determine offsetTop of an element and set it on other element -
there list of items. if item clicked anoter view revealed beside item. want view have same offsettop item. know how in jquery, cannot find solution in pure angularjs. tried far
top = angular.element('#user'+user.id).prop('offsettop'); angular.element('#feed-details').css('margin-top', top);
this has no effect. ideas how achieve in angularjs?
lengths must have unit. offsettop
unitless number. add "px"
it.
that said, in vanilla javascript:
document.getelementbyid('feed-details').style.margintop = document.getelementbyid('user'+user.id).offsettop+"px";
Comments
Post a Comment