Thursday, May 23, 2024
 Popular · Latest · Hot · Upcoming
161
rated 0 times [  168] [ 7]  / answers: 1 / hits: 34538  / 15 Years ago, sun, march 7, 2010, 12:00:00

I'm able to resize the height with the $.fancybox.resize(); part, but the width just doesn't update according to the new content. Thoughts?


More From » jquery

 Answers
23

From the fancybox api docs:



$.fancybox.resize: Auto-resizes FancyBox height to match height of content.



So it looks like it is not intended to adjust the width.



If you wish to adjust the width, you can do it by manually resizing the #fancybox-wrap and #fancybox-inner elements. After some very quick checking, it looks like #fancybox-wrap is set to 20px wider than #fancybox-inner:



$('#fancybox-inner').width(400);
$('#fancybox-wrap').width(420);


You can also control the width when you first register fancybox using the width option:



$('#somelink').fancybox({ width: '100px' });

[#97404] Thursday, March 4, 2010, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
karyme

Total Points: 545
Total Questions: 102
Total Answers: 120

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
;