Skip to content

Commit

Permalink
Update flip.js
Browse files Browse the repository at this point in the history
  • Loading branch information
simplydesigner authored Oct 13, 2016
1 parent 7d7c56e commit e57a6cb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/flip.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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...
Expand All @@ -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();
Expand Down

0 comments on commit e57a6cb

Please sign in to comment.