javascript gestures (swipeLeft, swipeRight) use css3 animation to freeze, turn on hardware acceleration

Today, while working on a mobile project, I encountered the phenomenon of css3 animation stuck.

examples:

In the gesture sliding (swipeLeft, swipeRight), I encountered the phenomenon of animation stuck, and finally used css3 animation -webkit-transform: transition3d(0,0,0) to open the  GPU hardware acceleration  mode to solve it.

This kind of GPU hardware acceleration has been popularized on PCs and mobile devices today, and the performance improvement on the mobile terminal is quite significant, so it is recommended that you try to enable GPU hardware acceleration when doing animations.

Go directly to the code:

<div class="Hypertension-Exhibition f">
<div class="box">
<ul>
<li>
<img src="./img/2.jpg"/>
<i>Cialitadalafil Tablets</i>
<var>¥543.00<em>  20mg*8 tablets/box</em></var>
<span>View details</span>
</li>
<li>
<img src ="./img/2.jpg"/>
<i>Cialitadalafil Tablets</i>
<var>¥543.00<em>  20mg*8 tablets/box</em>< /var>
<span>View Details</span>
</li>
<li>
<img src="./img/2.jpg"/>
<i>Cialis Tadalafil</i>
< var>¥543.00<em>  20mg*8 tablets/box</em></var>
<span>View details</span>
</li>
<li>
<img src="./img/2.jpg"/>
<i>Xi Ai Litadalafil Tablets</i>
<var>¥543.00<em>  20mg*8 tablets/box</em></var>
<span>View Details</span>
</li>
<li>
<img src="./img/2.jpg"/>
<i>Cialitadalafil</i>
<var>¥ 543.00<em>  20mg*8 tablets/box</em></var>
<span>View details</span>
</li>
<li>
<img src="./img/2.jpg "/>
<i>Cialitadalafil Tablets</i>
<var>¥543.00<em>  20mg*8 tablets/box</em></var>
<span>View Details< /span>
</li>
</ul>
</div>
</div>

js code:

After the real machine test, the stuttering phenomenon does not exist, and the animation becomes smooth.

Got off work and left. . .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324811793&siteId=291194637