点击div [英] Click through div

查看:108
本文介绍了点击div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在通知悬停时,我希望它使半透明的透明度,并能像这个通知插件中的点击通知插件Pines通知

When on notification hover, i want it to make opacity to semi transparent and being able to click through it like in this notification plugin Pines Notify

我尝试使用 pointer-events:none ,但是它禁用了DOM元素,所以jQuery不工作在这个元素。我需要jQuery来执行代码时,当悬停和悬停出。

I tried using pointer-events:none, but then it disables DOM element, so jQuery isn't working on this element. I need jQuery to execute code when on hover and on hover out. How can it be done ?

推荐答案

为了能够点击div使用以下

To be able to click through a div use the following


  1. 隐藏重叠div

  2. 触发对覆盖元素的点击

  3. 再次

http://jsfiddle.net / H6UEU / 1 /

$('#front-div').click(function (e) {
    $(this).hide();
    $(document.elementFromPoint(e.clientX, e.clientY)).trigger("click");
    $(this).show();
});
$(".tobeclicked").click(function(){
    $("#result").append("clicked<br />");
});

这篇关于点击div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆