0
我正在處理父項內的子項旋轉。父母是固定的寬度和高度,而孩子的寬度和高度是動態的。居中旋轉Div
比方說,
Child width - Cw
Child height - Ch
Parent width - Pw
Parent height - Ph
When `Cw > Pw && Ch < Ph` then expected: `left=0 and vertically centered`
When `Cw < Pw && Ch > Ph` then expected: `top=0 and horizontally centered`
When `Cw > Pw && Ch > Ph` then expected: `left=0 and top=0`
When `Cw < Pw && Ch < Ph` then expected: `vertically and horizontally centered`
小提琴 - http://jsfiddle.net/Xja29/1/
我已經嘗試了很多在過去的幾天裏。我正在做的一個小提琴在這裏。只要你不相信 - http://jsfiddle.net/zgvEC/50/
http://jsfiddle.net/TTGCh/檢查這出#e:aw,高度是搞砸了 – Misiur