Search code examples
javascriptjqueryhtmlcssfancybox

Width and height issue with fancybox


When I've added this code no setting on width and height works

jQuery(document).ready(function() {
  $('a.iframe').fancybox(); 
});

What are the options to get around it?


Solution

  • Take a look at the documentation here: http://fancybox.net/api

    You're using inline content, so make sure that you're setting the autoDimensions option to false along with the width and height settings.

    UPDATE: I tested the following solution successfully:

        $('a.fbtag').fancybox({
            autoDimensions: false,
            height: 300,
            width: 400
        }); 
    

    This assumes that the class name of the link you're opening is 'fbtag'.