CSS transform is not working in Edge - html

I am stuck at the following problem.
On this site that I created, I have a gallery which is located on the bottom of the page. If I hover over the thumbs, they fly around like crazy which is not what I want. It works like a charm on other browsers; only Microsoft Edge is affected.
Can someone help me out to get the images to behave as expected?
The CSS looks like this:
.node-gallery {
float: left;
width: 150px;
height: 150px;
position: relative;
margin: 0 60px 50px 0;
}
.node-gallery img {
position: absolute;
bottom: 0px;
}
.node-gallery .image1 {
left: 0px;
z-index: 3;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease
}
.node-gallery .image2 {
left: 7px;
height: 148px;
z-index: 2;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease
}
.node-gallery .image3 {
left: 14px;
height: 145px;
z-index: 1;
-webkit-transition: all 0.2s ease;
-moz-transition: all 0.2s ease;
-o-transition: all 0.2s ease
}
.image1, .image2, .image3 {
border: 5px solid #F3F3F3!important;
box-shadow: 1px 1px 2px #666;
-webkit-shadow: 1px 1px 2px #666;
-webkit-transform: rotate(0deg) translate(0px);
}
.node-gallery:hover .image1 {
z-index: 6;
-ms-transform: rotate(-5deg) translate(-20px, -2px);
-ms-transform-origin: center bottom;
-webkit-transform: rotate(-5deg) translate(-20px, 2px);
-webkit-transform-origin: center bottom;
-moz-transform: rotate(-5deg) translate(-20px, -2px);
-moz-transform-origin: center bottom;
-o-transform: rotate(-5deg) translate(-20px, -2px);
-o-transform-origin: center bottom;
}
.node-gallery:hover .image2 {
z-index: 5;
-ms-transform: rotate(-2deg) translate(0px, 2px);
-ms-transform-origin: center bottom;
-webkit-transform: rotate(-2deg) translate(0px, -2px);
-webkit-transform-origin: center bottom;
-moz-transform: rotate(-2deg) translate(0px, 2px);
-moz-transform-origin: center bottom;
-o-transform: rotate(-2deg) translate(0px, 2px);
-o-transform-origin: center bottom;
}
.node-gallery:hover .image3 {
z-index: 4;
-ms-transform: rotate(5deg) translate(20px, -2px);
-ms-transform-origin: center bottom;
-webkit-transform: rotate(5deg) translate(20px, 2px);
-webkit-transform-origin: center bottom;
-moz-transform: rotate(5deg) translate(20px, -2px);
-moz-transform-origin: center bottom;
-o-transform: rotate(5deg) translate(20px, -2px);
-o-transform-origin: center bottom;
}

Few months late on this, but I believe I just encountered this same bug and found a solution. It seems like Microsoft Edge 13 has a problem interpreting some normally acceptable values for transform-origin. Specifically for me, it was ignoring the value right center, but working fine with top left, leading me to believe the center value (which I see in your example code) might be the issue.
The fix for me was to use percentage values, so transform-origin: center bottom would become transform-origin: 50% 100%. Hope this helps anyone else who encounters this issue.
Note that despite the top-voted answer suggesting the ms- prefix, this question is about the recent MS Edge browser, and that prefix has not been required since Internet Explorer 9 for the transform property (per caniuse.com).

Ed. by another user: This answer does not apply to the Microsoft Edge browser.
You need to write the standard transition and transform properties, and then the -ms prefix for microsoft internet explorer:
.selector {
-webkit-transform: scale(); /* android, safari, chrome */
-moz-transform: scale(); /* old firefox */
-o-transform: scale(); /* old opera */
-ms-transform: scale(); /* old IE */
transform: scale(); /*standard */
}
The same in transition property. Your solution is to write the standard.

I found some differences:
When I try rotate (transform) element with display:inline, that not work in EDGE.
But, when I use display: inline-block then transform works.
Just try this (in MS EDGE):
<style>
#good span { display: inline-block; transform: rotate(-10deg); }
#bad span { transform: rotate(-10deg); }
</style>
<div id="good"><span>WELCOME</span></div>
<div id="bad"><span>WELCOME</span><div>

Try do to this,
Your gallery images using the fancybox API.SO there is option for change the animation types in fancybox.js.
Reference:http://fancybox.net/api
You need to go fancybox js file,find 'transitionIn, transitionOut' change to effect of The transition type. Can be set to 'elastic', 'fade' or 'none'.
According to the windows all browsers will be fine.

Related

skew and change perspective of image and its border going from one direction to another

I would like to skew and change perspective of the image (height from top and bottom) going from one direction to another.I am not 100% sure if I am using right terminology but below example should explain what I am trying to achieve.
Example of the image with border:
Example* of how it should appear on my web page:
Or another example from reference question
This is what I have tried
Get the final image and use it as is but the problem is that the
image quality deteriorates when width is changed.
Bunch of css options http://jsfiddle.net/6ksayLx8/
/*Attempt 1*/
#box {
width: 200px;
height: 200px;
/*background-color:green;*/
position: relative;
-webkit-transition: all 200ms ease-in;
-moz-transition: all 200ms ease-in;
-o-transition: all 200ms ease-in;
transition: all 200ms ease-in;
}
#box:after, #box:before {
display: block;
content:"\0020";
color: transparent;
width: 211px;
height: 45px;
background: white;
position: absolute;
left: 1px;
bottom: -20px;
-webkit-transform: rotate(-12deg);
-ms-transform: rotate(-12deg);
-o-transform: rotate(-12deg);
-moz-transform: rotate(-12deg);
transform: rotate(-12deg);
}
#box:before {
bottom: auto;
top: -20px;
-webkit-transform: rotate(12deg);
-ms-transform: rotate(12deg);
-o-transform: rotate(12deg);
-moz-transform: rotate(12deg);
transform: rotate(12deg);
}
/*Attempt 2*/
.skew {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
backface-visibility: hidden;
/* the magic ingredient */
-webkit-transform: skew(-16deg, 0);
-moz-transform: skew(-16deg, 0);
-ms-transform: skew(-16deg, 0);
-o-transform: skew(-16deg, 0);
transform: skew(-16deg, 0);
overflow: hidden;
width: 300px;
height: 260px;
position: relative;
left: 50px;
border: 1px solid #666;
}
.skew img {
-moz-transform: skew(16deg, 0);
-ms-transform: skew(16deg, 0);
-o-transform: skew(16deg, 0);
-webkit-transform: skew(16deg, 0);
transform: skew(16deg, 0);
position: relative;
left: -40px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="col-xs-6">
<div id="box">
<img src="http://placehold.it/560x366" class="img-responsive">
</div>
</div>
<div class="col-xs-6">
<div class="skew">
<img src="http://placehold.it/560x366" class="img-responsive">
</div>
</div>
</div>
</div>
Other details:
Website uses Bootstrap3 and so the solution should be responsive
Image must have border
I am fine not supporting anything less than IE 9
I have gone thru many links and different search terms in Google below are worthy to be mentioned:
CSS3 Transform Skew
CSS Skew only container, not content
CSS Transform maker
*Please discard the difference of color and scroll bar in this example image. This is just an example to explain outcome.
Today I stumbled upon this article https://viget.com/inspire/angled-edges-with-css-masks-and-transforms and it seems to do the task I was looking for (I already moved on with image solution but just pasting this here for others) and live example can be found on https://savingplaces.org/

firefox rounded div get cropped while transition with overflow hidden to parent

I am just doing a simple scale on a rounded div, see the fiddle.
It works well on Chrome and Safari, but in Firefox a part of the rounded div get cropped during the transition and get back to normal after that.
It can be fixed:
with a non transparent background on the parent.
without the overflow: hidden of the parent.
without the rotation on the parent.
But i can't use this fixes for what I am making here.
All this stuff works in Chrome and Safari, so if anyone knows why firefox act like this i would be pleased to know.
Thanks
Here is the css :
.petale-wrapper
{
width: 200px;
height: 100px;
position: relative;
transform: rotate(-20deg);
overflow: hidden;
-webkit-transform: rotate(-20deg);
-moz-transform: rotate(-20deg);
}
.petale
{
position: absolute;
left: 50px;
top: 50px;
width: 150px;
height: 75px;
border-radius: 75px 75px 0 0;
background-color: cyan;
transition: transform 0.5s;
-webit-transition: -webkit-transform 0.5s;
-moz-transition: -moz-transform 0.5s;
transform: scale(1) rotate(60deg);
-webkit-transform: scale(1) rotate(60deg);
-moz-transform: scale(1) rotate(60deg);
}
.petale:hover
{
transform: scale(1.2) rotate(60deg);
-webkit-transform: scale(1.2) rotate(60deg);
-moz-transform: scale(1.2) rotate(60deg);
}
Here is the html:
<div class="petale-wrapper">
<div class="petale">
</div>
</div>

Grainy button transform in firefox

I am trying to transform a button, but it is really grainy (During the transform) in firefox.
Can someone take a look, the code is below... and the js fiddle link is attached here https://jsfiddle.net/L3f9cy7g/1/
As I said. The issue is only in firefox, and I think it has something to do with anti-aliasing. We tried switching it to a 3d transform, and adjusting the z-index to prevent the firefox browser from messing with the animation. No luck so far.
<div class="closePop">
<p></p>
</div>
body{background:black;}
.closePop {
right: -5px;
top: -5px;
height: 28px;
background-color: #f68d1e;
color: white;
border-radius: 50%;
width: 29px;
text-align: center;
border-style: solid;
border-width: 2px;
vertical-align: middle;
cursor: pointer;
transform: rotate(0deg);
transition: all .3s ease-out;
}
.closePop p {
margin: 0;
margin-top: 4px;
}
.closePop:hover p:after {
content:':(';
transition:contentArea 3s ease-out rotate .3s ease-out;
-webkit-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: translateZ(1px) rotate(0deg);
}
.closePop p:after {
content: 'X';
transition: all .3s ease-out;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: translateZ(1px) rotate(90deg);
}
.closePop:hover {
border-radius: 0;
-webkit-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: translateZ(1px) rotate(90deg);
}
.closePop p {
transition: contentArea .3s ease-out rotate .3s ease-out;
}
Try to add a transparent outline attribute,
outline: 1px solid transparent;

Random IE10 seam displays when doing a translation with a border-radius

I am looking for a little advice for what seems to be a rendering bug in IE10. I created a animated-flip and it work in all the browsers I care about. While in testing I find random borders-like lines getting displayed for no reason. They are not actual border, outlines nor shadows being applied from what I can tell. It seems like the child elements (such as the anchor in the example) are simply not being rendered correctly.
I know a similar effect can happen on mobile-safari and people use margin-whatever: -1 but that does not seem to have an effect here.
I cut down the example to the bare minimum needed to reproduce the bug. It seems if I remove any of these styles the problem goes away.
perspective: 2000px; // Remove and the animation looks awful
border-radius: 6px; // Remove and the modal will look different then all others
-ms-transform: rotateY(0);
transition: all 0.4s ease-in-out;
DEMO
My example may help you
body {
background: #555;
}
.pt, .front {
width: 100px;
}
.pt {
margin: 0 auto;
}
.front {
position: absolute;
background: #FFF;
padding: 20px;
transform: scale(0.8) scaleZ(1.0) rotateX(9deg) rotateY(9deg);
transform-origin: 0% 0%;
perspective: 200;
perspective-origin: 50% 50%;
-webkit-transform: scale(0.8) scaleZ(1.0) rotateX(9deg) rotateY(9deg);
-webkit-transform-origin: 0% 0%;
-webkit-perspective: 200;
-webkit-perspective-origin: 50% 50%;
-moz-transform: scale(0.8) scaleZ(1.0) rotateX(9deg) rotateY(9deg);
-moz-transform-origin: 0% 0%;
-moz-perspective: 200;
-moz-perspective-origin: 50% 50%;
-o-transform: scale(0.8) scaleZ(1.0) rotateX(9deg) rotateY(9deg);
-o-transform-origin: 0% 0%;
-o-perspective: 200;
-o-perspective-origin: 50% 50%;
-ms-transform: scale(0.8) scaleZ(1.0) rotateX(9deg) rotateY(9deg);
-ms-transform-origin: 0% 0%;
-ms-perspective: 200;
-ms-perspective-origin: 50% 50%;
transition: all 0.4s ease-in-out;
-webkit-transition: all 0.4s ease-in-out;
-moz-transition: all 0.4s ease-in-out;
-o-transition: all 0.4s ease-in-out;
border-radius: 6px 6px 6px 6px;
-moz-border-radius: 6px 6px 6px 6px;
-webkit-border-radius: 6px 6px 6px 6px;
}

How to fix roll link in IE11

I use 3D roll links on my website using HTML5 and CSS3.
I'm used to make Modernizr available for IE and older browsers, but IE11 is detected as compatible with 3D css animation... and it's not.
On IE 11 :
expected :
actual result :
So the question is :
How can I use Modernizr on Internet Explorer 11? The goal is to use 3D Roll Links or fallback on non-animated CSS.
Here's my HTML's <head> :
<!--[if IE]>
<script src="js/modernizr.js"></script>
<![endif]-->
Here is the CSS I use :
/* ROLL LINKS */
.roll {
display: inline-block;
overflow: hidden;
vertical-align: top;
-webkit-perspective: 600px;
-moz-perspective: 600px;
-ms-perspective: 600px;
perspective: 600px;
-webkit-perspective-origin: 50% 50%;
-moz-perspective-origin: 50% 50%;
-ms-perspective-origin: 50% 50%;
perspective-origin: 50% 50%;
}
.roll:hover {text-decoration: none;}
.roll span {
display: block;
position: relative;
padding: 0 2px;
-webkit-transition: all 400ms ease;
-moz-transition: all 400ms ease;
-ms-transition: all 400ms ease;
-webkit-transform-origin: 50% 0%;
-moz-transform-origin: 50% 0%;
-ms-transform-origin: 50% 0%;
-webkit-transform-style: preserve-3d;
-moz-transform-style: preserve-3d;
-ms-transform-style: preserve-3d;
}
.roll:hover span {
background: #b1162c;
-webkit-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
-moz-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
-ms-transform: translate3d( 0px, 0px, -30px ) rotateX( 90deg );
}
.roll span:after {
content: attr(data-title);
display: block;
position: absolute;
left: 0;
top: 0;
padding: 0 2px;
color: #fff;
background: #b1162c;
-webkit-transform-origin: 50% 0%;
-moz-transform-origin: 50% 0%;
-ms-transform-origin: 50% 0%;
-webkit-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
-moz-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
-ms-transform: translate3d( 0px, 105%, 0px ) rotateX( -90deg );
}
There's a CSS trick to have a fallback with 3D Roll Links on incompatible browser. Add this to your CSS :
/* no 3d transform fix */
.no-csstransforms3d .roll span:after {
display:none;
}
.no-csstransforms3d .roll:hover span {
color:#fff;
background:#b1162c;
}
.no-csstransforms3d .roll:hover span {
-webkit-transform:none;
-moz-transform:none;
-o-transform:none;
transform: none
}
/* ie10 fix */
.no-cssreflections .roll span:after {
display:none;
}
.no-cssreflections .roll:hover span {
color:#fff;
background:#b1162c;
}
.no-cssreflections .roll:hover span {
-webkit-transform:none;
-moz-transform:none;
-o-transform:none;
transform: none
}
As you can see, you'll need Modernizr to activate this fallback, which is just a colored link. And while the [if IE] method works for Internet Explorer 8, 9, 10... it won't work on IE11. Because Microsoft thought their browser could now handle "modern" coding (and ooooh they were wrong).
So, the trick is to use javascript to load the modernizr.js if the browser is IE11. Just add this to your HTML's <head> :
<script type="text/javascript">
if(window.ActiveXObject || "ActiveXObject" in window){
<!--
var n='<script src="js/modernizr.js">';
var d='<\/script>';
document.write(n + d); //
-->
}
</script>
This will write the HTLM page differently if IE11 is detected, by adding <script src="js/modernizr.js"></script> to the code. It's simply a more difficult [if IE].
If you combine your previous CSS and HTML to this CSS fallback and this javascript for IE11 detection, you'll be fine.