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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -