1
아래 코드가 있습니다. 최대화되지 않은 창으로 페이지를 새로 고침합니다. 3 가지 경우에보고 된 너비는 동일합니다. 크기를 조정하지 않는 이유는 창 너비를 100으로 늘리는 것입니까?resizeTo는 윈도우 크기를 조정하지 않습니다. (자바 스크립트)
또한 Firefox와 IE10에서는 jQuery에서보고 한 너비와 Javascript에서 너비가 다릅니다. 크롬에서 그들은 동일합니다. 왜 이러한 가치가 브라우저에서 낮아 졌는가? (가) window
크기를 조정하려고하는 것은 팝업하지 않는 한
<script type="text/javascript" language="JavaScript">
$(document).ready(function ($) {
if (window.console) console.log("Old width: " + $(window).width());
window.setTimeout(WindowResize, 3000);
//WindowResize();
});
function WindowResize()
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
width = document.body.offsetWidth;
height = document.body.offsetHeight;
}
else
{
width = window.outerWidth;
height = window.outerHeight;
}
if (window.console) console.log("Old width2: " + $(window).width() + " width: " + width);
window.resizeTo(width + 100, height);
if (window.console) console.log("New width: " + $(window).width());
}
</script>
코드가 표시되지 않습니다. – Mohayemin