使用javascript设置IFrame allowfullscreen [英] Set IFrame allowfullscreen with javascript

查看:106
本文介绍了使用javascript设置IFrame allowfullscreen的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试将allowfullscreen属性设置为iframe,但它不起作用:

  iframe.allowFullScreen = true 

我使用chrome检查了它 - > inspect元素,但iframe在此代码后没有allowfullscreen属性。

在此先感谢,

iframe.setAttribute('allowFullScreen','')


I tried to set allowfullscreen attribute to the iframe, but it doesn't work:

iframe.allowFullScreen = true

I checked it with chrome -> inspect element, but the iframe has no allowfullscreen attribute, after this code.

Thanks in advance,

解决方案

iframe.setAttribute('allowFullScreen', '')

这篇关于使用javascript设置IFrame allowfullscreen的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆