Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fancybox iframe dimension

In the fancybox homepage (http://fancybox.net/home) there is an example that opens an iFrame dimensioned as the 75% of the screen.

I can't get it by modifying the width and height properties on the .js file as described on the site.

like image 229
iperdiscount Avatar asked Mar 17 '10 18:03

iperdiscount


3 Answers

You should try this:

$('iframeLink').fancybox({
'width':300,
'height':200,
'type':'iframe',
'autoScale':'false'
});
like image 157
user348402 Avatar answered Sep 22 '22 16:09

user348402


Hi I just read through all of these and I had to take bits and pieces of what everyone else wrote to get it to work. I wanted a window 600 by 410

First change the java script I dealt with the file: jquery.fancybox-1.3.4.js (this may change with later versions) under defaults set your height and width

width : 600, height : 410,

*then change the script on your webpage

$("#various3").fancybox({

'width' : 600,

'height' : 410,

'autoScale' : false,

'type' : 'iframe'

please note the size is not in single quotes! I wasted an hour before I saw this mistake.

This should help. Now if someone can tell me how to get this iframe to pop up on page load.

like image 30
Fred Avatar answered Sep 22 '22 16:09

Fred


I'm guessing you should set the fancybox height as

$(window).height() * 0.75 

but I would personally prefer to do it with pixels like

$(window).height() - 80
like image 27
snez Avatar answered Sep 21 '22 16:09

snez