Sizing for iFrame

44 views
Skip to first unread message

Jason Mendelke

unread,
Sep 6, 2017, 10:26:00 AM9/6/17
to FancyBox

Hi everybody. I'm trying to use FancyBox to open some HTML banners in an iFrame. I'm able to get the iFrame to display the banner, however, I cannot get it to size properly. Currently I'm using the sample files that were supplied with examples that I'm tweaking before I put code into my site. I'll show my code below. I'm editing the "Various examples" section and I'm playing with the iFrame (id=various3).


$("#various3").fancybox({
                'width'                      : '300px', 
                'height'                     : '250px',
                'autoScale' : true,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});



Various examples
</p>

<ul>
<li><a id="various1" href="#inline1" title="Lorem ipsum dolor sit amet">Inline</a></li>
<li><a id="various2" href="ajax.txt">Ajax</a></li>
<li><a id="various3" href="banners/Comcast_BFTV_300x250/" title="Comcast Xfinity Black Film and TV">Iframe</a></li>
</ul>


Thanks!

Jason Mendelke

unread,
Sep 6, 2017, 11:16:39 AM9/6/17
to FancyBox
I figured it out. I tried removing "px" from it and that didn't work. I removed "px" and the ' ' and now it's popping at 300x250.

Jason Mendelke

unread,
Sep 6, 2017, 11:18:11 AM9/6/17
to FancyBox
$("#various3").fancybox({
                'width'                      : 300, 
                'height'                     : 250,
                'autoScale' : true,
'transitionIn' : 'none',
'transitionOut' : 'none',
'type' : 'iframe'
});

Reply all
Reply to author
Forward
0 new messages