Techiio-author
Started by Marrine MorelSep 15, 2021

Open
How to add a transparent layer above an iframe?

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

I am trying to detect clicks on an iframe, but I found that no clicks on iframe can be detected.

So I am thinking of a work around:

add a transparent layer (a div) above the iframe. If iframe's z-index is 0, the layer's would be 1 or larger.

Then I will be detecting clicks on this layer, which should be doable.

And the layer should have the exactly same dimentions as the iframe, and be placed at the exactly same position.

I am wondering how to do that?

If I add the layer before the iframe in HTML, the former will be displayed on Y-axis above the latter, but the desired effect is that the former is displayed on Z-axis above the latter.

I may be able to use JavaScript code to find the iframe's demensions and positions, and set the same values to the layer, but it seems to be not elegant.

Any bettet solution?

Or, it anyone can teach me how to detech clicks on iframe, that would be optimal!

Any hints will be appreciated!

0 Replies

You must be Logged in to reply
Trending Technologies
15
Software40
DevOps46
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance