前端 鼠标滑过图片透明文字遮罩向上滑出效果 动画

编程入门 行业动态 更新时间:2024-10-21 04:11:27

前端 <a href=https://www.elefans.com/category/jswz/34/1769042.html style=鼠标滑过图片透明文字遮罩向上滑出效果 动画"/>

前端 鼠标滑过图片透明文字遮罩向上滑出效果 动画

 

<div style="display: inline-block;"><h3>鼠标滑过图片透明文字遮罩向上滑出效果</h3><divclass="parent-hover-class"@mouseenter="clickShow(item, true)"@mouseleave="clickShow(item, false)"v-for="(item, index) in imageList":key="index"><img :src="item.url" style="max-width:396px;height: 297px;" /><div class="hover-class" v-show="item.isShow">{{ item.content }}</div></div>
</div>data() {return {imageList: [{ url: image3, isShow: false, content: "殷白雪" },{ url: image4, isShow: false, content: "紫萱" },{ url: image12, isShow: false, content: "杨玉环" },{ url: image13, isShow: false, content: "晴儿" },{ url: image8, isShow: false, content: "王昭君" },{ url: image9, isShow: false, content: "马尔泰·若曦" },{ url: image7, isShow: false, content: "王语嫣" },{ url: image11, isShow: false, content: "杨玉环" },]}
},
methods: {clickShow(item, val) {item.isShow = val;}
}<style scoped>
.parent-hover-class {max-width: 396px;height: 297px;cursor: pointer;display: inline-block;margin: 5px;float: left;
}
.hover-class {background: rgba(255, 90, 88, 0.7);max-width: 396px;height: 297px;display: flex;align-items: center;justify-content: center;color: #fff;cursor: pointer;position: relative;top: -301px;
}
@keyframes slider {0% {height: 0px;position: relative;top: 0;}100% {height: 297px;position: relative;top: -301px;}
}
.hover-class {animation: slider 0.5s;
}
</style>

更多推荐

前端 鼠标滑过图片透明文字遮罩向上滑出效果 动画

本文发布于:2024-02-27 06:53:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1705594.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:鼠标   滑过   滑出   透明   效果

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!