简体   繁体   English

如何在离子 3 中禁用 iframe 的滚动

[英]How to disable scroll of iframe in ionic 3

I'm developing Hybrid E-commerce app using Ionic Framework v3 .我正在使用Ionic Framework v3开发混合电子商务应用程序。 I have set iframe in my app with third party url.我在我的应用程序中使用第三方 url 设置了 iframe。 Its working properly but i want to disable scrolling inside iframe .它工作正常,但我想禁用 iframe 内的滚动 I have tried many things like我尝试了很多事情,比如

  1. scrolling="no" set inside iframe在 iframe 内设置scrolling="no"
  2. iframe { overflow: hidden } Set css iframe { overflow: hidden }设置 css
  3. $("iframe").contents().find("#body").addClass("iframeclass") I have also use jQuery but no luck. $("iframe").contents().find("#body").addClass("iframeclass")我也使用过 jQuery 但没有运气。

I can disable it manually from browser when i set overflow: hidden inside iframe > html > Body tag, but don't know how to do it with code.当我设置overflow: hidden在 iframe > html > Body 标记中,但不知道如何使用代码执行此操作。

Here is my code please check and suggest me proper way.这是我的代码,请检查并建议我正确的方法。

 <iframe class="iframPlace" [src]="sanitizer.bypassSecurityTrustResourceUrl(browselink)" scrolling="no"></iframe>

Thank you.谢谢你。

if set width and height for iframe, bigger than source, scroll is hidden otherwise iframe have a scroll because an HTML iframe is used to display a full web page within in web page and it's impossible to disable scroll. if set width and height for iframe, bigger than source, scroll is hidden otherwise iframe have a scroll because an HTML iframe is used to display a full web page within in web page and it's impossible to disable scroll.

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

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