U
<?php echo "<iframe src="https://height-450/width-" . "XXXXXX" . " frameborder='0' scrolling='no' allowfullscreen='true'></iframe>"; ?>
$(window).resize(function() {
$("#dimensions").html($(window).width());
}).resize();
No es requiero php en lo que andas haciendo
parte superior;
<script type="text/javascript">
window.addEventListener('resize',function(){document.getElementById('mse').style.height=window.innerHeight+'px';});
</script>
uso
height: window.innerHeight,
width: window.innerWidth
ejemplo
var iframe = "<iframe src="https://height-450/width-" . "+ window.innerHeight +" . " frameborder='0' scrolling='no' allowfullscreen='true'></iframe> ";
iframe{
max-width: 1300px;
width: 100%;
height: auto;
}
mmm ponele un max-width y width: 100% a los iframes (height: auto)... ejemplo
PHP:iframe{ max-width: 1300px; width: 100%; height: auto; }
y no necesitas andar modificando cada iframe ni nada... eso se adapta solo al tamaño de pantalla del usuario
Que va, esos embed tienen un tamaño que se indica en el src, el width y height del iframe es aparte.
Fíjate: "<iframe src="https://domain/height-450/width-800" ...
Son así.
<iframe src="https://domain/height-450/width-{width}/id_delvideo" id="search_iframe" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>
<script>
$(function() {
var urlBase = $('#search_iframe').attr('src');
var ChangeWidth = function () {
var w = $(window).width();
var src = urlBase.replace('{width}', w);
setTimeout(function () {
$('#search_iframe').attr('src', src);
}, 5);
}
ChangeWidth();
$(window).resize(function() {
ChangeWidth();
}).ready();
});
</script>
y que valor tiene $max, $width y $height ?iframe{
max-width: <?php echo $max; ?>px;
width: <?php echo $width; ?>px;
height: <?php echo $height; ?>px;
}
y listo.
y que valor tiene $max, $width y $height ?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?
Utilizamos cookies y tecnologías similares para los siguientes fines:
¿Aceptas las cookies y estas tecnologías?