Vue實(shí)現(xiàn)PC端靠邊懸浮球的代碼
我想把退出登錄的按鈕做成一個懸浮球的樣子,帶動畫的那種。
實(shí)現(xiàn)是這個樣子:
手邊沒有球形圖。隨便找一個,功能這里演示的為單機(jī)懸浮球注銷登錄
嗯,具體代碼:
<div :@mouseleave='uploadleave' @mouseenter='uploadenter' v-if='uploadShow' @click.stop='logout' > <img :src='http://www.aoyou183.cn/bcjs/require(’@/assets/1.png’)'/> </div>
data
uploadShow: false, uploadflag: true,
js方法
uploadenter() { this.uploadflag = true; }, uploadleave() { this.uploadflag = false; }, uploadanimated() { setTimeout(() => { this.uploadShow = true; setTimeout(() => { this.uploadleave(); }, 1000); }, 1000); },
css
.off{ -webkit-animation:1s seconddiv; background: transparent; } @keyframes seconddiv{ 0% {transform: scale(1.4,1.4);} 10% {transform: scale(1,1);} 25% {transform: scale(1.2,1.2);} 50% {transform: scale(1,1);} 70% {transform: scale(1.2,1.2);} 100% {transform: scale(1,1);} } .meun-switch { position: fixed; top: 90px; left: 0px; z-index: 2001; cursor: pointer; width: 150px; height: 150px; padding: 5px; transition: all 0.25s; &.leave { left: -65px; } &.active { left: 0; } &:hover { transform: scale(1.02); } img { width: 120px; height: 120px; } }
總結(jié)
到此這篇關(guān)于Vue實(shí)現(xiàn)PC端靠邊懸浮球的代碼的文章就介紹到這了,更多相關(guān)Vue靠邊懸浮球內(nèi)容請搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. 在終端啟動Python時(shí)報(bào)錯的解決方案2. 利用FastReport傳遞圖片參數(shù)在報(bào)表上展示簽名信息的實(shí)現(xiàn)方法3. 如何基于Python和Flask編寫Prometheus監(jiān)控4. ASP.NET MVC視圖頁使用jQuery傳遞異步數(shù)據(jù)的幾種方式詳解5. java必懂的冷知識點(diǎn)之Base64加密與解密6. python軟件測試Jmeter性能測試JDBC Request(結(jié)合數(shù)據(jù)庫)的使用詳解7. 詳解php如何合并身份證正反面圖片為一張圖片8. AJAX實(shí)現(xiàn)省市縣三級聯(lián)動效果9. XHTML 1.0:標(biāo)記新的開端10. python字典通過值反查鍵的實(shí)現(xiàn)(簡潔寫法)
