document ready function js-mc-fancybox_item- preview fancybox fitToVie

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$(document).ready(function() {
$('.js-mc-fancybox_item-preview').fancybox({
'fitToView' : false,
'autoSize' : false,
'width': 985,
'maxWidth': 985,
'minWidth': 985,
'type': 'iframe',
'wrapCSS': 'mc-preview-item_fancybox',
'beforeShow':
function(){
//this.width = ($('.fancybox-iframe').contents().find('body').width() + 400);
this.height = ($('.fancybox-iframe').contents().find('body').find('.card-page').height()) + 100;
//this.height = ($('.fancybox-iframe').contents().find('body').find('.card-page').width()) + 100;
},
onUpdate: function(){
//this.width = ($('.fancybox-iframe').contents().find('body').width() + 400);
//this.height = ($('.fancybox-iframe').contents().find('body').find('.card-page').width()) + 100;
this.height = ($('.fancybox-iframe').contents().find('body').find('.card-page').height()) + 100;
}
});
});