Home  >  Article  >  Web Front-end  >  How to get the value of transform in jquery

How to get the value of transform in jquery

php中世界最好的语言
php中世界最好的语言Original
2018-03-15 15:31:543069browse

This time I will bring you jqueryHow to get the value of transform, jquery gets the transform value NotesYes Which ones, the following are practical cases, let’s take a look.

I used transform's translateX to write a side-sliding effect. How to get the value it changed?

How to get the translateX value:

$('p').css("transform").replace(/[^0-9\-,]/g,'').split(',')[4];

Get it directly with css() like this:

Use regular expressions to get the value inside it:

Then just get the fifth value

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Usage of jQuery EasyUI folding panel

jQuery+localStorage implements timer

Practical jQuery drawer-style online customer service

The above is the detailed content of How to get the value of transform in jquery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn