Get divs position after translate3d

前端 未结 3 1511
日久生厌
日久生厌 2021-02-10 00:51

In Javascript, when I move an element using the gpu via the translate3d method, the elements style-left position doesnt change at all. As the cpu isnt even aware any motion has

3条回答
  •  甜味超标
    2021-02-10 01:19

    The style attribute left is set to auto if you do not set it manually. But you should be able to use the jquery function position().

        var position = $('#element').position();
        var left = position.left;
    

    http://jsfiddle.net/nqab2aw7/2/

提交回复
热议问题