Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

using fancybox set height and width

i am new to j query, it is cool, but i am glued to the ceiling on how to add width and height to a iframe generated after click, using this code: all suggestions would be great and thanks in advance Khadija

$(document).ready(function () {
    $(".fancybox").fancybox();
 })
 .height = '600px';
like image 664
user1498036 Avatar asked Jul 03 '12 07:07

user1498036


2 Answers

You must set autoSize to false

$(".fancybox").fancybox({'width':400,
                         'height':300,
                         'autoSize' : false});
like image 134
timactive Avatar answered Oct 21 '22 09:10

timactive


To initialize the fancybox popup for the usage of an iframe, limited to a certain width and height, you need at least three parameters:

jQuery

$(document).ready(function(){ 
  $(".fancybox").fancybox({
    'width'  : 600,           // set the width
    'height' : 600,           // set the height
    'type'   : 'iframe'       // tell the script to create an iframe
  });
}); 

You can read all about the available options at the FancyBox API Page.

like image 33
Zuul Avatar answered Oct 21 '22 09:10

Zuul