Quantcast
Channel: MarsHut
Viewing all articles
Browse latest Browse all 6551

facebook cover picture with angularjs

$
0
0
Hello everyone! im trying to develop "facebook cover" feature for my app.
However i meet difficulties.
im trying to give to the element the top css but the Y = $event.clientY
returns me doesnt help me a lot.

in mouse down event i get Y with the above way and in a mousemove function
there is this line
pos = $event.clientY- Y; and
elm.css({top: pos+"px"});
However doesnt work well because in every mouse "drag" the photo goes in
pos position but in the second drag photo doesnt start from the last
position! The image in the div has the position: relative attribute!
Do you have any ideas in order to solve the problem?

Viewing all articles
Browse latest Browse all 6551

Trending Articles