javascript - 点击按钮触发按钮 "under"他

标签 javascript jquery css jquery-mobile mobile

我有一个按钮:

position : fixed, z-index :1000

<input class="confirmCrop" type="button" value="CONFERMA" />

当我点击这个按钮(带有“移动点击事件”)时,他下面的按钮在点击后被触发。

<input type="file" ...

我试过像这样停止点击传播:

 $(".confirmCrop").on("tap", function(e){
    e.stopPropagation();

但它不起作用。

现在我正在使用这个解决方法(在点击后立即禁用所有其他按钮),它在一定程度上起到了作用,但我觉得这个解决方案不太合适,有什么帮助可以找到更好的解决方案吗?

$(".confirmCrop").on("tap", function(){
    $('.ui-btn').prop("disabled",true);

(.ui-btn) 是页面中的所有其他按钮(我正在使用 jquery mobile)。

编辑:一张图片以便更好地理解:

screen

我使用重叠对图像进行裁剪编辑。

最佳答案

这应该可以解决问题:

 $(".confirmCrop").on("tap", function(e){
            e.preventDefault();

关于javascript - 点击按钮触发按钮 "under"他,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45848976/

相关文章:

javascript - 限制 .each() 循环中条目的更简单方法

javascript - 变量上的 Jquery 选择器

javascript - 如何提取textarea值中#和空格之间的值

javascript - 将一些基于 jQuery 的代码转换为原生 javascript,这种情况可能吗?

javascript - Web 服务使用 jQuery post JSON 接收 null

javascript - 动态分配变量到jquery自动完成查询字符串

javascript - jQuery 单击未触发

javascript - 使用 CSS 重新排序多个 div

html - 输入类型搜索 - 如何获得白色的占位符和清除按钮?

html - 为 css Sprite (图像)菜单设置事件类