Home > Web Front-end > JS Tutorial > body text

How to get the value of transform in jquery

php中世界最好的语言
Release: 2018-03-15 17:26:53
Original
2105 people have browsed it

This time I will bring you jqueryHow to get the value of transform, what are the precautions for jquery to get the transform value, the following is a practical case , 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];
Copy after login

Get it directly with css() like this:

Use regular expressions to get the value inside it:

Then just get the fifth value

The above jquery method to get the value in transform is all the content shared by the editor. I hope it can To give you a reference, I also hope that everyone will support Script House.

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:

How to implement Ajax drop-down box without refresh linkage

How to confirm whether jQuery is loaded

jQuery implements drop-down menu navigation

Mobile touch screen slides the first letter of Pinyin to select the city

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template