Use vue to simply implement a click flip effect for your reference. The specific content is as follows 1. 2. 3. //html code test demo naming copied randomly <div class="Demo"> <div class="Before" :class="isTop ? 'contain-Before' : ''" @click="handleBefore"></div> <div class="After" :class="isTop ? 'contain-After' : ''" @click="handleAfter" style="font-size:20px;color:black">This is the back content</div> </div> //Define isTop:false in data //Method handleBefore() in methods{ if(!this.isTop){ this.isTop = true } }, handleAfter(){ if(this.isTop){ this.isTop = false } } //css .Demo{ width: 375px; height: 300px; margin-top: 50px; /* margin-left: 500px; */ position: relative; perspective: 800px; box-sizing: border-box; } .Before{ width: 100px; height: 200px; position: absolute; top:0; left: 0; background-repeat: no-repeat; background-position: center center; backface-visibility: hidden; transition: 1.5s; background-image:url('../assets/images/chunfen4.jpg'); border:1px solid yellow; } .After{ width: 100px; height: 200px; position: absolute; top:0; left: 0; color: #fff; background-color:#fff; text-indent: 2em; transform: rotateY(-180deg); backface-visibility: hidden; transition: 1.5s; border:1px solid yellow; } .Demo .contain-Before{ transform: rotateY(180deg); } .Demo .contain-After{ transform: rotateY(0deg); } You are done. If you want to slide and flip, remove the event yourself and add the :hover method to div. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: How to optimize MySQL deduplication operation to the extreme
>>: Deploy Varnish cache proxy server based on Centos7
The Linux operating system has revolutionized the...
Table of contents 1. JavaScript Objects 1).Array ...
wedge Because the MySQL version installed on the ...
We know that there are two ways to receive incomi...
max_allowed_packet is a parameter in MySQL that i...
First of all, the formation of web page style main...
View mysqlbinlog version mysqlbinlog -V [--versio...
ContentsHyperledger fabric1.4 environment setup u...
A Thorough Analysis of HTML (14) Special Characte...
This article shares the specific code of JavaScri...
Overview The fundamental difference between async...
This article shares the specific code of js to im...
Table of contents 0. Background 1. Installation 2...
Editor: This article discusses the role that inte...
Problem Description As we all know, when writing ...