jquery - 移动端如何写弹性效果
黄舟
黄舟 2017-04-17 11:41:39
0
2
598

在这个网页的第2个例子【自适应 / 全屏 + 分页】中
http://www.swiper.com.cn/demo/index.html
如果按住鼠标向右拖动,会发现可以拖动,然后放开鼠标,就会"弹"回去,观察代码发现,是用了下面这个css3代码
transition-duration: 0ms; transform: translate3d(86.6443px, 0px, 0px);
那么问题来了,这个拖拉后弹回去的js效果要怎么写呢?哪位大神有思路?提供一下啦。谢谢!

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(2)
Peter_Zhu

Add css3 transition animation to the element. The value of the transition animation is the x-axis of transform3d. The distance dragged by the finger is the value of the x-axis. When the finger is released, the x-axis value is restored, which is 0px

巴扎黑

See if the API has a sliding effect or write an animation yourself. It is nothing more than adjusting the Bezier curve to appear in the cache

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template