Breakout perspective for better IE11 support. (#594)
This commit is contained in:
committed by
GitHub
parent
20fe5189fb
commit
1bf05799a0
@@ -133,11 +133,6 @@
|
||||
return " scale(" + s + ") ";
|
||||
};
|
||||
|
||||
// `perspective` builds a perspective transform string for given data.
|
||||
var perspective = function( p ) {
|
||||
return " perspective(" + p + "px) ";
|
||||
};
|
||||
|
||||
// `getElementFromHash` returns an element located by id from hash part of
|
||||
// window location.
|
||||
var getElementFromHash = function() {
|
||||
@@ -384,7 +379,8 @@
|
||||
css( root, {
|
||||
top: "50%",
|
||||
left: "50%",
|
||||
transform: perspective( config.perspective / windowScale ) + scale( windowScale )
|
||||
perspective: ( config.perspective / windowScale ) + "px",
|
||||
transform: scale( windowScale )
|
||||
} );
|
||||
css( canvas, rootStyles );
|
||||
|
||||
@@ -504,9 +500,13 @@
|
||||
// that both of them are finished.
|
||||
css( root, {
|
||||
|
||||
// For IE 11 support we must specify perspective independent
|
||||
// of transform.
|
||||
perspective: ( config.perspective / targetScale ) + "px",
|
||||
|
||||
// To keep the perspective look similar for different scales
|
||||
// we need to 'scale' the perspective, too
|
||||
transform: perspective( config.perspective / targetScale ) + scale( targetScale ),
|
||||
transform: scale( targetScale ),
|
||||
transitionDuration: duration + "ms",
|
||||
transitionDelay: ( zoomin ? delay : 0 ) + "ms"
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user