gpt4 book ai didi

jquery - 使用css3在图像上按下效果

转载 作者:太空宇宙 更新时间:2023-11-04 09:25:37 25 4
gpt4 key购买 nike

在我的混合移动应用程序中,我有多个图标,我想在点击图标时重现按下效果。

HTML:

 <div class="menuIcon" id="menuIcon">
<img src="img/menu.svg" />
</div>

CSS:

.menuIcon {
width: 32px;
height: 32px;
position: absolute;
left: 20px;
top: 28px;
}

.menuIcon img {
width: 19px;
height: 19px;
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}

我想重现的新闻效果在推特应用程序中可见:你可以在这里看到它: https://vid.me/gub5

最佳答案

你可以这样解决,使用 transform: scale:active

.menuIcon {
width: 32px;
height: 32px;
position: absolute;
left: 20px;
top: 28px;
}
.menuIcon img {
width: 32px;
height: 32px;
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.menuIcon img:active {
transform: scale(0.8);
}
<div class="menuIcon" id="menuIcon">
<img src="http://placehold.it/100" />
</div>

关于jquery - 使用css3在图像上按下效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41121954/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com