[9.2.11] iframe responsive

This commit is contained in:
fredtempez 2019-11-23 23:07:12 +01:00
parent c459f0a774
commit 3df45ed42e
1 changed files with 2 additions and 0 deletions

View File

@ -317,6 +317,7 @@ core.start = function() {
var _this = $(this);
_this
.data("ratio", _this.height() / _this.width())
.data("maxwidth", _this.width())
.removeAttr("width height");
});
// Prend la largeur du parent et détermine la hauteur à l'aide du ratio lors du resize de la fenêtre
@ -324,6 +325,7 @@ core.start = function() {
elementDOM.each(function() {
var _this = $(this);
var width = _this.parent().first().width();
if (width > _this.data("maxwidth")){ width = _this.data("maxwidth");}
_this
.width(width)
.height(width * _this.data("ratio"));