Charlau
unread,Oct 14, 2011, 9:19:09 PM10/14/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to fanc...@googlegroups.com
I'm doing it this way in a current project. Works pretty well :
(from within the container page)
// Resizing to max its content height, but never more than the viewport. Needed for my project, but optional
var max_h = $("#fancybox-frame").contents().height();
var viewport_h = document.documentElement.clientHeight - 30;
var new_h = ((max_h < viewport_h) ? max_h : viewport_h);
$('#fancybox-content').css('height', function() { return parseInt(new_h) });
$.fancybox.center();
(if called from the iframed page itself)
var max_h = parent.$("#fancybox-frame").contents().height();
var viewport_h = parent.document.documentElement.clientHeight - 30;
var new_h = ((max_h < viewport_h) ? max_h : viewport_h);
parent.$('#fancybox-content').css('height', function() { return parseInt(new_h) });
parent.$.fancybox.center();