Click through div to underlying elements

后端 未结 16 2098
逝去的感伤
逝去的感伤 2020-11-21 06:19

I have a div that has background:transparent, along with border. Underneath this div, I have more elements.

Curre

16条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-21 06:47

    1. Hide overlaying the element
    2. Determine cursor coordinates
    3. Get element on those coordinates
    4. Trigger click on element
    5. Show overlaying element again
    $('#elementontop').click(e => {
        $('#elementontop').hide();
        $(document.elementFromPoint(e.clientX, e.clientY)).trigger("click");
        $('#elementontop').show();
    });
    

提交回复
热议问题