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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -