Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
68
rated 0 times [  70] [ 2]  / answers: 1 / hits: 26043  / 8 Years ago, thu, august 11, 2016, 12:00:00

In my code I am setting the allowfullscreen attribute of my iframe which is surrounded by SkyLight which is an npm module for modal views in react.js



            <SkyLight dialogStyles={myBigGreenDialog} hideOnOverlayClicked ref=simpleDialog>
<iframe src=url frameborder=0 width=960 height=569 allowfullscreen=true></iframe>;
</SkyLight>


However when I check the page my iframe does not have the property allowfullscreen:
pre



When I manually add the attribute allowfullscreen=true in the console, however, the iframe can go full screen.



Does anyone know how to make sure the allowfullscreen attribute exists without manually adding it through the console?


More From » iframe

 Answers
31

See the documentation.



React is case sensitive, the attribute is called allowFullScreen, not allowfullscreen. It is also a boolean attribute so true is not a valid value for it.



<iframe src=http://example.com frameborder=0 width=960 height=569 allowFullScreen></iframe>


see a live demo


[#61070] Monday, August 8, 2016, 8 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
freddiem

Total Points: 456
Total Questions: 116
Total Answers: 101

Location: Dominica
Member since Mon, Jan 4, 2021
3 Years ago
;