我需要使用动画将元素从一个偏移位置移动到另一个偏移位置。 我正在使用
function getOffset(el) {
el = el[0].getBoundingClientRect();
return {
left: el.left + window.scrollX,
top: el.top + window.scrollY
}
}
var _anchorElemPos = getOffset($element)
_animationElement.animate(_targetAnimPos); /*_targetAnimPos is the position where the element has to move.*/
它工作得非常好。但现在我想要没有 jquery animate()
函数的动画。
如有任何帮助,我们将不胜感激。
最佳答案
试试 CSS3 动画。对于移动,您可以使用 CSS3 中的关键帧
关于javascript - 不使用 jquery animate() 动画元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41561332/