D
D
drtvader2015-10-12 10:49:10
JavaScript
drtvader, 2015-10-12 10:49:10

How to display content in fancybox?

Good afternoon! The essence of the question is this, how to make another page open in full size, without taking into account the screen?
Answer:

$("#b").fancybox({ 
openEffect : 'none', 
closeEffect : 'none', 
type : 'iframe', 
width: 800, 
onComplete : function(e) { 
$('#fancybox-frame').load(function() { 
var iframe = document.getElementById("fancybox-frame"); 
var iframewrap = document.getElementById("fancybox-content"); 
console.log(iframe); 
console.log(iframewrap.height); 
iframewrap.style.height = iframe.contentDocument.body.scrollHeight + 30 + 'px'; 
iframe.style.height = iframe.contentDocument.body.scrollHeight + 'px'; 
}); 
} 
});

Thank you littleguga

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
littleguga, 2015-10-12
@drtvader

Like this picture opens in full size.

$("#b").fancybox({ 
openEffect : 'none', 
closeEffect : 'none', 
type : 'iframe', 
width: 800, 
onComplete : function(e) { 
$('#fancybox-frame').load(function() { 
var iframe = document.getElementById("fancybox-frame"); 
var iframewrap = document.getElementById("fancybox-content"); 
console.log(iframe); 
console.log(iframewrap.height); 
iframewrap.style.height = iframe.contentDocument.body.scrollHeight + 30 + 'px'; 
iframe.style.height = iframe.contentDocument.body.scrollHeight + 'px'; 
}); 
} 
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question