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 6025591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:19:20+00:00 2026-05-23T04:19:20+00:00

I cannot read a CSS3 transform rotate value in: Opera 9.62 Opera 10.51 FireFox

  • 0

I cannot read a CSS3 transform rotate value in:

  • Opera 9.62
  • Opera 10.51
  • FireFox 4.01

Works fine in IE, Chrome and Safari, but not in these three above.
Here is the source:

<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="jquery-1.6.1.min.js"></script>
    <style>
        div {
            -webkit-transform:     rotate(-5deg);
            -moz-transform:        rotate(-5deg);
            -o-transform:        rotate(-5deg);
            -ms-transform:        rotate(-5deg);
            transform:            rotate(-5deg);
            border: 1px solid black;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {

            // tries to read the CSS rotate data
            // starts by reading -webkit-transform, if it
            // fails then read -moz-transform and so on
            var getRotation = function ($e) {
                var value = $e.css('-webkit-transform');
                if (value === undefined) {
                    value = $e.css('-moz-transform');
                    if (value === undefined) {
                        value = $e.css('-o-transform');
                        if (value === undefined) {
                            value = $e.css('-ms-transform');
                            if (value === undefined) {
                                value = $e.css('transform');
                            }
                        }
                    }
                }
                return value === undefined? '' : value;
            };

            var returnValue = getRotation($("div"));
            alert(returnValue === ''?
                "Failed to get rotation info!" : 
                "Got it: " + returnValue);
        });
    </script>
</head>
<body>
    <div>rotated</div>
</body>
</html>

live sample on jsfiddle here

So, I want to use jquery css() to read the rotation angle, but strangely, Opera 10.51 and FF 4.01 (and below) cannot read it, although the div is rendered correctly with a rotation effect.

This looks like a jQuery bug or a browser bug. Does anyone have a workaround for Opera/FF?

If you get an alert saying “Got it” then it works.

Thanks for the help.

  • 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-23T04:19:21+00:00Added an answer on May 23, 2026 at 4:19 am

    Ok, I figured out the problem. The problem was on my code, that was not checking properly the return values from the css() getter.

    Before I had:

    if (value === undefined) {...
    

    The problem was fixed, by changing the above condition to:

    if (notDefined(value)) {...
    

    where notDefined is the function

    var notDefined = function(value) {
        return value == null || value == undefined || value == "" || value == "none";
    } 
    

    To be cross browser, I need to compare against all these 3 cases, not only undefined.

    You can see the update here

    It works for all the latest versions of IE (also IE7 and 8), Firefox, Safari, Chrome and Opera.

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

Sidebar

Related Questions

I've read the related questions but I cannot find one that suits my problem(or
I have read quite a few selcet+update questions in here but cannot understand how
I read the SDK document, but can not understand some details, need some help.
Like asked here I got the problem, that I cannot read the value of
I'm getting this error on Chrome & IE Cannot read property 'tagName' of null
I've read this: http://groups.google.com/group/play-framework/browse_thread/thread/1df0a77ef811a225 but not found the answer in fact i have turned
I've read that you cannot read the HTML of another frame if that frame
A client wants to ensure that I cannot read sensitive data from their site,
Using python 2.4 and the built-in ZipFile library, I cannot read very large zip
Ignoring unsafe code, .NET cannot have memory leaks. I've read this endlessly from many

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.