Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6643363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:02:32+00:00 2026-05-26T00:02:32+00:00

So I searched google and stackoverflow for a solution but I can not find

  • 0

So I searched google and stackoverflow for a solution but I can not find an answer. My problem is that I can not rotate an element with Internet Explorer 8.
I used
this site and this stackoverflow topic as resources and finally came to the following result:

function rotateElement(e, deg) {
    var deg_str = deg + "";
    var rotate_transform = "rotate(" + deg + "deg)";

    var degreeToIEMatrix = function(deg){   
        var deg2radians = Math.PI / 180;
        var rad = deg * deg2radians ;
        var costheta = Math.cos(rad);
        var sintheta = Math.sin(rad);

        var M11 = costheta;
        var M12 = -sintheta;
        var M21 = sintheta;
        var M22 = costheta;

        return 'M11=' + M11 + ', M12=' + M12 + ', M21=' + M21 + ', M22=' + M22;
    };

   /* @cc_on
       matrix_str = degreeToIEMatrix(deg);
       document.write(matrix_str);
       filter_str = "progid:DXImageTransform.Microsoft.Matrix(" + matrix_str + ", sizingMethod='auto expand')";
   @*/

    e.style["rotation"] = deg_str + "deg";      // CSS3
    e.style.MozTransform = rotate_transform;    // Moz
    e.style.OTransform = rotate_transform;      // Opera
    e.style.WebkitTransform = rotate_transform; // Webkit/Safari/Chrome
    e.style["zoom"] = "1"; // ??? Probably IEs

    /* @cc_on
        e.style.filter = filter_str;            // IE 6/7
        e.style.MsFilter = filter_str;          // IE 8
    @*/
}

With Internet Explorer 8 the element does not rotate. Is there a bug in my code or is it bad anyway? I know I could use JQuery for this, but I don’t want to depend on a library. I looked up the source of JQuery but could not find an answer there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:02:32+00:00Added an answer on May 26, 2026 at 12:02 am
    function rotate(angle, elem){
            if (angle >= 0) {
            var rotation = Math.PI * angle / 180;
        } else {
            var rotation = Math.PI * (360+angle) / 180;
        }
            var c = Math.cos(rotation),
            s = Math.sin(rotation);
           elem.style.filter = "progid:DXImageTransform.Microsoft.Matrix(M11="+c+",M12="+(-s)+",M21="+s+",M22="+c+",SizingMethod='auto expand')";
    }
    

    It’s just for IE! 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've searched through stackoverflow and google's extension FAQ but could not seem to find
I searched around google and stackoverflow, but didnt quite find the right answer. im
I searched in google and stackoverflow for my problem, but couldn't find a good
I searched on StackOverflow and Google and I can't find the answer to this
I have searched all over the Google and StackOverFlow, but still did not find
I searched google but couldn't find an answer to this rather simple question. I
I searched google this morning and could not find an answer, so I would
I have googled and searched here on stackoverflow, but haven't been able to find
I have searched on google and stackoverflow for a while, but didn't really found
I've already searched at Stackoverflow and google, but haven't found what I'm looking for.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.