Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fancybox width not applying

Using the following JS the width isn't being adjusted. It doesn't get adjusted when I use '750' or '750px'

$('a#city-prompt').fancybox({
    'width': 750
});

I've posted on the fancybox forums about this and haven't gotten a response

like image 558
Webnet Avatar asked Feb 12 '11 22:02

Webnet


2 Answers

You probably have to set autoSize to false:

$('a#city-prompt').fancybox({
    'width': 750,
    'autoSize': false
});

About width from the documentation:

Width for content types 'iframe' and 'swf'. Also set for inline content if 'autoDimensions' is set to 'false'

like image 138
Felix Kling Avatar answered Sep 25 '22 13:09

Felix Kling


None of the answers here worked for me, but this did the trick:

$.fancybox({
    'content':$("#element").html(),
    'width':'500',
    'autoDimensions':false,
    'type':'iframe',
    'autoSize':false
});

The 'autoSize':false was the missing key

like image 34
d-_-b Avatar answered Sep 23 '22 13:09

d-_-b