CSS3 旋转Y 没有应用过渡
我正在寻找一种简单的方法来获取对象并转换其rotateY 属性,而无需对其预设的过渡进行动画处理。 这将帮助我完成此幻灯片(仅在 Chrome 或 SAFARI (WEBKIT) 中查看) )
下面是效果的细分示例:
CSS - 过渡设置为 5s
Phase1
Element1 -rotateY:0;
Element2 - 旋转Y:-180;
用户 - 单击按钮
阶段2
元素1 - 旋转Y:180;
Element2 - 旋转Y:0;
Phase3
Element1 - 旋转Y:-180;
Element2 - 旋转Y:0;
用户 - 单击按钮
阶段4
Element1 -rotateY:0;
元素2 - 旋转Y:180;
第一次转换(phase1 和 2)完成后,Element1 的rotateY 值需要在没有转换的情况下设置为 -180,以便它位于 Element2 在 Phase1 中的位置。这样,动画将使元素看起来彼此旋转,正如您在我提供的示例链接中看到的那样。不幸的是,在所有元素都有其rotateY:180之后,效果就会停止;
我想做一个 jsFiddle 但我现在真的没有时间做这个项目。
我需要一个解决方案,只需将对象从 a 点带到 b 点,无需任何动画/过渡
希望一切都有意义
I'm looking for a simple way to take an object and transform its rotateY property without it animating to its pre-set transition. This will help me complete this slide show (ONLY VIEW IN CHROME OR SAFARI (WEBKIT))
Here's a breakdown example of the effect:
CSS - Transition is set to 5s
Phase1
Element1 - rotateY:0;
Element2 - rotateY:-180;
User - clicks button
Phase2
Element1 - rotateY:180;
Element2 - rotateY:0;
Phase3
Element1 - rotateY:-180;
Element2 - rotateY:0;
User - clicks button
Phase4
Element1 - rotateY:0;
Element2 - rotateY:180;
After first transition (phase1 & 2) completes the rotateY value of Element1 needs to be set to -180 without a transition so that it's in the position Element2 was in in Phase1. With this the animation will make the elements appear to spin around one another as you can see on the example link I have supplied. Unfortunately the effect ceases after all elements have their rotateY:180;
I'd like to do a jsFiddle but I really haven't time right now on this project.
I need a solution that simply takes the object from point a to b without any animation/transition
Hope that all makes sense
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您尝试在没有过渡的情况下旋转对象,那么您根本不应该设置过渡。仅设置变换:
旋转时不显示过渡的实时示例: http://jsfiddle.net/2XU7D/4/
If you are trying to rotate an object without a transition, then you should not be setting a transition at all. Only set the transform:
Live example to show no transition when rotated: http://jsfiddle.net/2XU7D/4/
或者,您可以做一件事,创建两个类:
并检查您想要事件的类。
Alternatively you can do one thing, creates two classes:
and checks the class you want the event.