diff --git a/src/flip.js b/src/flip.js index 74decb9..16c1ac0 100644 --- a/src/flip.js +++ b/src/flip.js @@ -1,3 +1,6 @@ +/*! flip - v1.1.1 - 2016-05-25 +* https://github.com/nnattawat/flip +* Copyright (c) 2016 Nattawat Nonsung; Licensed MIT */ (function( $ ) { /* * Private attributes and method @@ -169,7 +172,8 @@ }; var backElementCss = { "transform": rotateAxis + "(" + (self.setting.reverse ? "180deg" : "-180deg") + ")", - "z-index": "0" + "z-index": "0", + "position": "relative" }; var faceElementCss = { "backface-visibility": "hidden", @@ -196,12 +200,14 @@ elementCss["-webkit-transform-style"] = "preserve-3d"; } - self.element.css(elementCss); - self.backElement.css(backElementCss); + faces.css(faceElementCss).find('*').css({ "backface-visibility": "hidden" }); + self.element.css(elementCss); + self.backElement.css(backElementCss); + // #39 // not forcing width/height may cause an initial flip to show up on // page load when we apply the style to reverse the backface... @@ -222,7 +228,7 @@ // While this used to work with a setTimeout of zero, at some point that became // unstable and the initial flip returned. The reason for this is unknown but we - // will temporarily use a short delay of 20 to mitigate this issue. + // will temporarily use a short delay of 20 to mitigate this issue. }, 20); self.attachEvents();