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

  • Home
  • SEARCH
  • 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 6958227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:06:45+00:00 2026-05-27T15:06:45+00:00

I need to detect if the CSS transform property has changed using jQuery. In

  • 0

I need to detect if the CSS transform property has changed using jQuery. In firebug the CSS property i’m looking to detect changes on is rendered like this:

-moz-transform: translate(-0px, 0px)

I need to detect whether this has changed to another pixel property. For example:

-moz-transform: translate(-100px, 0px)

More details:

Ultimately I’m trying to detect between a click and a drag on the following demo.

http://cubiq.org/dropbox/iscroll4/examples/carousel/

I figured that I could query mouseup on the current transform property and if it remained the same that it was a click or if the transform property changed it would be a drag.

  • 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-27T15:06:46+00:00Added an answer on May 27, 2026 at 3:06 pm

    You can use Modernizr to create the vender prefix and then you can use .split() to break apart the output from .css() and get the desired values.

    Here is a method of getting the properly prefixed property:

    if (Modernizr.csstransforms3d) {
        trans_key = Modernizr.prefixed('transform').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
    
    } else if (Modernizr.csstransforms) {
        trans_key = Modernizr.prefixed('transform').replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-');
    }
    

    Source: http://www.modernizr.com/docs/#prefixed

    Then you can use .css() to get the -vender-transform property:

    var matrix = $('#element-id').css(trans_key);//output = matrix(1, 0, 0, 1, 100px, 0px)
    

    Then finally you can .split() the matrix value into something useable:

    var data = matrix.replace(')', '').split(',');//data[4]='100px', data[5]='0px'
    

    Here is a demo: http://jsfiddle.net/7Yz8B/

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

Sidebar

Related Questions

I need to detect when a session has expired in my Visuial Basic web
I need to detect Image format to save a image like image1.jpg, image2.gif, but
I need to detect whether my Makefile is running under valgrind (indirectly, using valgrind
I need to detect character encoding in HTTP responses. To do this I look
I need to detect whether the user has pressed the dot key in the
I need to detect Android Clipboard's content changes, and register the changes, but I
Is there any way to detect that a CSS background image has been loaded?
I need to detect a procedure from a click event has finished without delaying
I need to detect when a video file has completed loading. I'm thinking I
I need to detect whether my application is running within a virtualized OS instance

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.