简体   繁体   English

防止从 iframe 滚动但仍可点击 javascript

[英]prevent scrolling from iframe but still clickable javascript

Is it possible to use the parent scroll when I start the scroll from the embedded iframe?当我从嵌入的 iframe 开始滚动时,是否可以使用父滚动? Currently I'm using pointer-event: none but the embedded iframe prevents clickable events.目前我正在使用pointer-event: none但嵌入的 iframe 会阻止可点击事件。 I tried also manipulate other events like touchmove but I failed.我也尝试操纵其他事件,如touchmove但我失败了。 Feel free to answer and thank you in advance!请随时回答并提前感谢您!

It's not possible to scroll the parent page from an iframe.无法从 iframe 滚动父页面。 However, you could consider using embed instead of iframe .但是,您可以考虑使用embed而不是iframe This will give you more control over how scroll works.这将使您更好地控制滚动的工作方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM