1

I am trying to disable the right-click on content. For that, I used the "pointer-events: none;" CSS property. But using that CSS property I am not able to scroll to see the complete content. If I use the "pointer-events: none;" property how do enable the scroll bar or For disable the right click instead of using the "pointer-events: none;" CSS property is there any other option we have.

Please find my sample code below. Please Any help appreciated.

Sample Application - Using this link you can check the code.

<!DOCTYPE html>
<html>
<body>

<iframe src="https://africau.edu/images/default/sample.pdf#toolbar=0" 
  style="pointer-events:none;" 
  title="Iframe Example"></iframe>

<script>

</script> 
</body>
</html>
  • Does this answer your question? [How do I disable right click on my web page?](https://stackoverflow.com/questions/737022/how-do-i-disable-right-click-on-my-web-page) – DecPK Jun 24 '21 at 15:37
  • @decpk yes. I tried that code but not working which I expected. – Bala Bhavani Illa Jun 24 '21 at 15:52
  • Since iframe has it's own window/document, you'd have to do it from within iframe page itself, can't do it from the parent page – vanowm Jun 24 '21 at 16:11
  • Is your parent domain is same as in iframe...? If both are same you can expose a method in iframe window object and invoke it from parent window on your desired event – Karthikeyan Jun 24 '21 at 16:30

0 Answers0