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
When receiving this requirement, Baidu found many...
The equal-width layout described in this article ...
Scenario: The crawled data generates a data table...
Today I will introduce the most basic functions of...
Click here to return to the 123WORDPRESS.COM HTML ...
1. Introduction A few days ago, a development col...
Take 3 consecutive days as an example, using the ...
This article example shares the specific code of ...
1. CSS3 triangle continues to zoom in special eff...
1. Environment version Docker version 19.03.12 ce...
Frameset pages are somewhat different from ordina...
1. RPM package installation steps: 1. Find the co...
This article uses examples to describe advanced u...
1. Floating layout 1. Let the fixed width div flo...
This article mainly introduces the implementation...