ブラウザ ウィンドウのサイズに応じて画像のサイズを変更する必要がある
window.onload = function(){
var x = $(window).innerWidth();
var y = $(window).innerHeight();
if (x > y) { land(); }
else { port(); }
function land() {
$('#slide').css('width', x/2); // works
//all other lines here work
};
次に、Firefox ウィンドウのサイズを縦向きレイアウトに変更し、キャッシュをクリアしてページをリロードします (F5)。
function port() {
alert (x); // works correctly
$('#slide').css('width', x/2); // doesn't work
//many other lines here don't work
};
}