CSS3 transform rotateY(180deg) - IE fallback

可紊 提交于 2019-12-02 20:36:30

问题


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


回答1:


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




回答2:


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" });



回答3:


You will need to use a filter

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


来源:https://stackoverflow.com/questions/13513921/css3-transform-rotatey180deg-ie-fallback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!