We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当将一个元素从 rotate3d(0,0,0,0) 变到 rotate3d(0,0,1,180deg) 的时候,理论上以及在chrome、安卓微信webview上都是顺时针旋转的,可是在safari及IOS的微信webview上就是逆时针的了。
rotate3d(0,0,0,0)
rotate3d(0,0,1,180deg)
有意思的是如果是变到 rotate3d(0,0,1,179.9deg) 所有浏览器都是顺时针的
rotate3d(0,0,1,179.9deg)
还有如果使用 rotateZ(0) 变到 rotateZ(180deg) 的时候所有浏览器都是顺时针的了,符合预期。让我费解的时 IOS 的策略,如果180deg的时候非要逆时针那就让 rotate3d 和 rotateZ 统一嘛,可是事实上却不是,不是自相矛盾吗?(有知道原因的童鞋请告知我~)
rotateZ(0)
rotateZ(180deg)
180deg
rotate3d
rotateZ
直接用 rotateZ 来做旋转动画,让所有浏览器都统一旋转方向
示例地址
<!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> <meta name="referrer" content="origin-when-cross-origin"> <meta name="apple-mobile-web-app-capable" content="yes"> <meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="format-detection" content="telephone=no"> <title>ios rotate180 bug</title> <style> .center{ position: relative; margin: 0 auto; text-align: center; } .rect{ position: absolute; box-sizing: border-box; display: inline-block; width: 100px; height: 200px; border-top:5px solid red; border-bottom: 5px solid blue; border-right: 5px solid green; border-left: 5px solid purple; transform: rotate3d(0,0,0,0deg); /*transform: rotateZ(0deg);*/ transition: all 5s; will-change: transform; } </style> </head> <body> <p>click to show rotation animation</p> <div class="center"> <div class="rect" id="J_Rect"></div> </div> </body> <script src="http://statics.mangguoyisheng.com/resource/demo/1.0.0/third-party/jquery/jquery-2.1.4.min.js"></script> <script> $('#J_Rect').click(function(){ $('#J_Rect').css({ 'transform': 'rotate3d(0,0,1,180deg)' // 'transform': 'rotateZ(180deg)' }); }); </script> </html>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题描述
当将一个元素从
rotate3d(0,0,0,0)
变到rotate3d(0,0,1,180deg)
的时候,理论上以及在chrome、安卓微信webview上都是顺时针旋转的,可是在safari及IOS的微信webview上就是逆时针的了。有意思的是如果是变到
rotate3d(0,0,1,179.9deg)
所有浏览器都是顺时针的还有如果使用
rotateZ(0)
变到rotateZ(180deg)
的时候所有浏览器都是顺时针的了,符合预期。让我费解的时 IOS 的策略,如果180deg
的时候非要逆时针那就让rotate3d
和rotateZ
统一嘛,可是事实上却不是,不是自相矛盾吗?(有知道原因的童鞋请告知我~)解决方案
直接用
rotateZ
来做旋转动画,让所有浏览器都统一旋转方向示例代码
示例地址
The text was updated successfully, but these errors were encountered: