TomD
TomD

Reputation: 181

CSS3 transform rotateY(180deg) - IE fallback

Is there an IE fallback for transform rotateY(180deg)? Need a 3D flip animation!

Upvotes: 0

Views: 5232

Answers (3)

LemonLion
LemonLion

Reputation: 79

I know this question is old, but I had the same problem last week. What you need is:

.flipHorizontal {
filter: "fliph";
}

More specifically, if you want to rotate it continuously on the y axis I've created a jquery plugin to use:

**
 * jQuery Rotate On Axis In IE Plugin 1.0.0
 *
 * Copyright (c) 2014 Aryeh Citron
 *
 * Licensed under MIT: http://www.opensource.org/licenses/mit-license.php
 */


(function ($)
{
    $.fn.rotateOnAxisInIE = function (options)
    {
        var settings = $.extend(
        {
            spinSpeed: "slow",
        }, options);

        return this.each(function ()
        {
            var startingInterval;
            switch (settings.spinSpeed)
            {
                case "slow": startingInterval = 0.006; break;
                case "medium": startingInterval = 0.01; break;
                case "fast": startingInterval = 0.03; break;
                default: startingInterval = 0.01; break;
            }

            var image = this;
            var imageWidth = 1;
            var gettingSmaller = true;
            var fullRotation = true;
            var interval = startingInterval;
            var increment = startingInterval / 4;
            var refreshRateInMilliseconds = 35;

            setInterval(function ()
            {
                $(image).css("msTransform", "scaleX(" + imageWidth + ")");
                if (gettingSmaller)
                {
                    interval = interval + increment;
                    imageWidth = imageWidth - interval;
                }
                else
                {
                    interval = interval - increment;
                    imageWidth = imageWidth + interval;
                }

                if (imageWidth <= 0)
                {
                    gettingSmaller = false;
                    if ($(image).css("filter") == "")
                        $(image).css("filter", "fliph");
                    else
                        $(image).css("filter", "");

                    imageWidth = 0.01;
                }
                if (imageWidth >= 1)
                {
                    gettingSmaller = true;
                }

                if (gettingSmaller && interval < 0)
                    interval = 0;

            }, refreshRateInMilliseconds);
        });
    };
}(jQuery));

Example Usage

$("#myImageId").rotateOnAxisInIE();

or

$("#myImageId").rotateOnAxisInIE({ spinSpeed: "fast" });

Upvotes: 0

Jesse
Jesse

Reputation: 799

I don't have IE8 to test with but I think this might work: (ie5.5+) filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

http://msdn.microsoft.com/en-us/library/ms532972%28VS.85%29.aspx

Matrix Filter for IE could be another option: http://msdn.microsoft.com/en-us/library/ms533014%28VS.85%29.aspx

I got the answer from this site when I was playing with something else: http://snook.ca/archives/html_and_css/css-text-rotation

Personally when using IE6-8 the tag that works best for me is display: none ;P

Upvotes: 2

toxicate20
toxicate20

Reputation: 5410

You will need to use a filter

#rotate {
 -ms-transform:rotateY(180deg); //IE9
}

Upvotes: -1

Related Questions