ToB企服应用市场:ToB评测及商务社交产业平台
标题:
(css)鼠标移入或点击改变背景图片
[打印本页]
作者:
用多少眼泪才能让你相信
时间:
2024-12-20 02:24
标题:
(css)鼠标移入或点击改变背景图片
(css)鼠标移入或点击改变背景图片
html
<div class="mapTip">
<div
v-for="(item, index) of legendList"
:key="index"
class="mapTipOne"
:class="{ active: change === index }"
@click="legendHandle(item, index)"
>
{{ item }}
</div>
</div>
复制代码
js
data() {
return {
...
change: null,
};
},
methods: {
// 点击方法
legendHandle(item, index) {
this.change = index;
},
}
复制代码
style
// 图例
.mapTip {
position: absolute;
top: 20px;
left: 20px;
font-size: 14px;
.mapTipOne {
width: 150px;
height: 30px;
background: url("@/assets/images/home-image/mian-right-middle-list-bg0.png")
no-repeat;
background-position: 0px 0px;
background-size: 100% 100%;
display: flex;
justify-content: center;
align-items: center;
margin-bottom: 6px;
cursor: pointer;
}
.active,
.mapTipOne:hover {
background: url("@/assets/images/home-image/mian-right-middle-list-bg1.png")
no-repeat;
background-position: 0px 0px;
background-size: 100% 100%;
}
}
复制代码
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
欢迎光临 ToB企服应用市场:ToB评测及商务社交产业平台 (https://dis.qidao123.com/)
Powered by Discuz! X3.4