當前位置:編程學習大全網 - 網站源碼 - html5如何設定高度自適應?

html5如何設定高度自適應?

代碼如下:

var width = document.documentElement.clientWidth;

//初始化高度?

$("#iFrame1").height(width*0.5);?

//當文檔窗口發生改變時 觸發?

$(window).resize(function(){?

$("#iFrame1").height(width*0.5);?

});

  • 上一篇:vscode壹般用來寫什麽
  • 下一篇:谷歌瀏覽器的內核是什麽?
  • copyright 2024編程學習大全網