I am facing a challenge of making an iframe click-through, while ensuring that the body of the iframe remains clickable. I have attempted to achieve this using the following code:
iframe.style.width = '100%'
iframe.style.height = '100%'
iframe.style.display = 'block'
iframe.style.position = 'fixed'
iframe.style.backgroundColor = 'transparent'
iframe.style.pointerEvents = 'none'
iframe.style.border = '0'
iframe.frameborder = '0'
iframe.scrolling = 'no'
iframe.allowTransparency = 'true'
Within the iframe's content, I have applied the following CSS:
html, body {
/* background:none transparent; */
pointer-events:auto;
}
While this setup successfully displays the body as desired, it also makes it click-through like the rest of the iframe. My goal is to make only the body clickable within the iframe, with the rest of the iframe being click-through.
It is important to note that the iframe is consistently larger than the content within it. Additionally, my limitations prevent me from accessing the iframe content through the main site, restricting me to only modifying its source code.