Use the iframe keyword to load content inside an iframe. By default, the iframe size is 300x150.
Iframe Attributes:
You can control iframe behavior using data-featherlight-iframe-* attributes in HTML or iframe* options in JavaScript. Supported attributes include:
allow, allowfullscreen, frameborder, height, longdesc, marginheight, marginwidth, mozallowfullscreen, name, referrerpolicy, sandbox, scrolling, src, srcdoc, style, webkitallowfullscreen, width.
Common usage:
- Set dimensions:
data-featherlight-iframe-height="640" data-featherlight-iframe-width="480" - Set styles:
data-featherlight-iframe-style="border:none" - Via JS:
$.featherlight({iframe: 'url.html', iframeWidth: 500, iframeHeight: 300});
<a href="http://www.example.com" data-featherlight="iframe">Open example.com in an iframe</a>
<!-- Example with dimensions and styles -->
<a href="http://www.youtube.com/embed/f0BzD1zCye0?rel=0&autoplay=1"
data-featherlight="iframe"
data-featherlight-iframe-width="640"
data-featherlight-iframe-height="480"
data-featherlight-iframe-frameborder="0"
data-featherlight-iframe-allow="autoplay; encrypted-media"
data-featherlight-iframe-allowfullscreen="true">
<img src="http://img.youtube.com/vi/f0BzD1zCye0/0.jpg" alt="" />
</a>