jquery - 2 个图像在彼此之上,一个在运行功能下

标签 jquery css

我有两个位于彼此顶部的图像。当我点击顶部图像时,它会调用底部图像函数。

$("#topImage").click(function(){
       alert("Top image clicked");

    });

$("#bottomImage").click(function(){
       alert("Bottom image clicked");

    });

在这里,当我点击 #topImage 时,它会出现 alert("Bottom image clicked");

最佳答案

我通过在适当的时候交换他们的 z-index 属性来实现这个功能。

关于jquery - 2 个图像在彼此之上,一个在运行功能下,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9954301/

相关文章:

css - 如何使用定位属性网站

html - getusermedia - 镜像而不是翻转

jquery - 将鼠标悬停在 div 中的图像上

jquery - 我缺少什么? Django - Ajax

javascript - 使用 jQuery 循环 JSON

JQuery UI 元素的图像未显示

javascript - JQuery 仅在满足特定条件时自动完成

html - 将 Bootstrap 图标添加到按钮

html - 复选框标签内的标签

html - 使用 html 表格时,在 CSS3 多列中强制分栏