vue實(shí)現(xiàn)右側(cè)滑出層動(dòng)畫
本文實(shí)例為大家分享了vue實(shí)現(xiàn)右側(cè)滑出層動(dòng)畫的具體代碼,供大家參考,具體內(nèi)容如下
效果圖:

代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="flexible" content="initial-dpr=2" />
<meta name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="author" content="bright2017" />
<title>css動(dòng)畫</title>
<link rel="stylesheet" type="text/css" href="css/reset.css" />
<script src="js/vue2.6.12.js" type="text/javascript" charset="utf-8"></script>
<style>
.search_page_list {
width: 100%;
position: relative;
}
.hidden_view {
width: 100%;
background: #000000;
opacity: 0.7;
position: fixed;
left: 0;
top: 0;
z-index: 9;
}
.click_animation {
text-align: center;
font-size: 20px;
padding: 100px 0;
}
.screen_cent {
width: 280px;
height: 600px;
position: absolute;
right: 0;
bottom: 0;
z-index: 9;
border-radius: 10px 0 0 10px;
overflow: hidden;
}
.screen_data {
width: 100%;
height: 100%;
background: #FFFFFF;
}
.show_view-enter {
animation: show_view-dialog-fade-in 1.5s ease;
}
.show_view-leave {
animation: show_view-dialog-fade-out 1.5s ease forwards;
}
.show_view-enter-active {
animation: show_view-dialog-fade-in 1.5s ease;
}
.show_view-leave-active {
animation: show_view-dialog-fade-out 1.5s ease forwards;
}
@keyframes show_view-dialog-fade-in {
0% {
transform: translateX(280px);
}
100% {
transform: translateX(0);
}
}
@keyframes show_view-dialog-fade-out {
0% {
transform: translateX(0);
}
100% {
transform: translateX(280px);
}
}
</style>
</head>
<body id="body">
<div class="search_page_list" id="app" :style="{height: win_height+'px'}">
<div class="click_animation" @click="screen_click">打開動(dòng)畫</div>
<div class="hidden_view" :style="{height: win_height+'px'}" v-show="show" @click="screen_hide_click"></div>
<transition name="show_view">
<div class="screen_cent" v-show="isshow">
<div class="screen_data" transiton="show_view"></div>
</div>
</transition>
</div>
<script type="text/javascript">
window.onload = function() {
// 初始化內(nèi)容
var app = new Vue({
el: '#app',
data: {
show: false,
isshow: false,
win_height: '',
},
mounted: function() {
// 生命周期
this.win_height = window.innerHeight;
},
methods: {
screen_click() {
// 顯示篩選
this.show = true;
this.isshow = true;
},
screen_hide_click() {
// 隱藏篩選
let that = this;
setTimeout(function() {
that.show = false;
}, 1500);
that.isshow = false;
}
}
});
}
</script>
</body>
</html>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
- vue+swiper實(shí)現(xiàn)左右滑動(dòng)的測(cè)試題功能
- vue使用swiper實(shí)現(xiàn)左右滑動(dòng)切換圖片
- vue使用better-scroll實(shí)現(xiàn)滑動(dòng)以及左右聯(lián)動(dòng)
- vue基于better-scroll實(shí)現(xiàn)左右聯(lián)動(dòng)滑動(dòng)頁面
- vue移動(dòng)端的左右滑動(dòng)事件詳解
- vue移動(dòng)端實(shí)現(xiàn)手機(jī)左右滑動(dòng)入場(chǎng)動(dòng)畫
- Vue移動(dòng)端右滑屏幕返回上一頁附源碼下載
- Vue實(shí)現(xiàn)移動(dòng)端左右滑動(dòng)效果的方法
- Vue路由切換時(shí)的左滑和右滑效果示例
- 基于Vue實(shí)現(xiàn)頁面切換左右滑動(dòng)效果
相關(guān)文章
vuex(vue狀態(tài)管理)的特殊應(yīng)用案例分享
Vuex 是一個(gè)專為 Vue.js 應(yīng)用程序開發(fā)的狀態(tài)管理模式。它采用集中式存儲(chǔ)管理應(yīng)用的所有組件的狀態(tài),并以相應(yīng)的規(guī)則保證狀態(tài)以一種可預(yù)測(cè)的方式發(fā)生變化。2020-03-03
Vue實(shí)現(xiàn)點(diǎn)擊當(dāng)前行變色
這篇文章主要為大家詳細(xì)介紹了Vue實(shí)現(xiàn)點(diǎn)擊當(dāng)前行變色,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-12-12
前端處理axios請(qǐng)求下載后端返回的文件流代碼實(shí)例
使用axios可以很方便地獲取后端返回的文件流數(shù)據(jù),并在前端直接在瀏覽器下載,這篇文章主要給大家介紹了關(guān)于前端處理axios請(qǐng)求下載后端返回的文件流的相關(guān)資料,需要的朋友可以參考下2024-07-07
el-table 選擇框根據(jù)條件設(shè)置某項(xiàng)不可選中的操作代碼
這篇文章主要介紹了el-table 選擇框根據(jù)條件設(shè)置某項(xiàng)不可選中的操作代碼,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友參考下吧2024-03-03
詳解VS Code使用之Vue工程配置format代碼格式化
這篇文章主要介紹了詳解VS Code使用之Vue工程配置format代碼格式化,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-03-03
Vue openLayers實(shí)現(xiàn)圖層數(shù)據(jù)切換與加載流程詳解
OpenLayers是一個(gè)用于開發(fā)WebGIS客戶端的JavaScript包,最初基于BSD許可發(fā)行。OpenLayers是一個(gè)開源的項(xiàng)目,其設(shè)計(jì)之意是為互聯(lián)網(wǎng)客戶端提供強(qiáng)大的地圖展示功能,包括地圖數(shù)據(jù)顯示與相關(guān)操作,并具有靈活的擴(kuò)展機(jī)制2022-09-09
vue如何在用戶要關(guān)閉當(dāng)前網(wǎng)頁時(shí)彈出提示的實(shí)現(xiàn)
這篇文章主要介紹了vue如何在用戶要關(guān)閉當(dāng)前網(wǎng)頁時(shí)彈出提示的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-05-05
vue中el-tree增加節(jié)點(diǎn)后如何重新刷新
這篇文章主要介紹了vue中el-tree增加節(jié)點(diǎn)后如何重新刷新,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-08-08

