screen.width の値を自分の定義した値に置き換える方法は?
私は偽物を定義したいscreen.width
:
var screen.width = 1024;
の<head>
以下のコードが読み込まれると、常に表示されるように = <h1>test 2</h1>
in anyscreen.width
私は次のコードを使用しています:
<script type="text/javascript">
if (screen.width>=1400)
{
document.write('<h1>test 1</h1>');
}else
{
document.write('<h1>test 2</h1>');
}
</script>
私の問題を明確に説明してくれることを願っています。