Increase Z-Index



我试图找到一种方法来增加Z-Index 1上的图像每次用户悬停在标题上。网址:https://thellendfortin.webflow.io/

当快速悬停在许多标题上时,有时会出现一个bug。理想情况下,每次我们悬停时,Z-Index都会增加+1。有办法做到这一点吗?

谢谢!

$('.project-title').on('mouseover',function() {
$(this).find('.image-thumbnail').css({
'z-index':'910',
});
$('.project-title').on('mouseout',function() {
$(this).find('.image-thumbnail').css({
'z-index':'905',
});

在Javascript中,我会使用'https://www.w3schools.com/jsref/prop_style_zindex.asp'属性来设置z-index,但老实说,这更像是css的事情,根本不应该有任何事件监听器。http://zomigi.com/blog/css3-transitions-and-z-index/: ~:文本= CSS3 % 20 % 20的转换和% 20 z - index % 20你% 20可以% 20应用% 20 CSS3,浏览器% 20 % 20 % 20保持% 20 z - index % 20在% 20 % 20数字。

最新更新