iframe
サイズを変更する必要があります。これは私のhtmlコードです
<iframe id="stream" width="720" height="433" src="#HiddedIt" style="border:0;outline:0" frameborder="0" scrolling="no"></iframe>
そして、これは私のJavascriptです:
if (window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth < 1100){
document.getElementById("stream").width = "485px";
document.getElementById("stream").height = "295px";
}
ユーザーの解像度が 1100 未満の場合、iframe のサイズは変更されません。どこが間違っているのか教えていただけますか? ありがとうございました。
if
は機能していますが、iframe
のサイズは変更されていません。