<body background="back06.gif"> |
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <link rel="stylesheet" href="javascript.css" type="text/css"> <title>JavaScript</title> </head> <body> <img src="bg.gif" width="100%" height="100%"> </body> </html> |
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>Scroll</title> <script type="text/javascript"> function cut(pos) { var s1 = '(0px,' + (640+pos) + 'px,480px,' + pos + 'px)'; var s2 = pos + 'px;top:0px;'; var s = 'clip:rect' + s1 + '; position:absolute;left:-' + s2; return s; } </script> </head> <body onLoad="setInterval('scroll()',25)"> <img src="bg2.gif" name="bg2" style="clip:rect(0px,640px,480px,0px); position:absolute;left:0px; top:0px;"> <script type="text/javascript"> var pos = 0; function scroll() { pos++; if (pos>=640) pos = 0; var str = cut(pos); //window.alert(str); document.bg2.style = str; } </script> </body> </html> |
<img src="bg2.gif" name="bg2" style="clip:rect(0px,640px,480px,0px); position:absolute;left:0px; top:0px;"> |
<body onLoad="setInterval('scroll()',25)"> |
function scroll() { pos++; if (pos>=640) pos = 0; var str = cut(pos); //window.alert(str); document.bg2.style = str; } |
function cut(pos) { var s1 = '(0px,' + (640+pos) + 'px,480px,' + pos + 'px)'; var s2 = pos + 'px;top:0px;'; var s = 'clip:rect' + s1 + '; position:absolute;left:-' + s2; return s; } |
<img src="bg4.gif" name="bg4" style="clip:rect(0px,1280px,960px,0px); position:absolute;left:0px; top:0px;"> |
var pos = 0; function scroll() { pos++; if (pos>=1280) pos = 0; var str = cut(pos); document.bg4.style = str; } |
function cut(pos) { var s1 = '(0px,' + (1280+pos) + 'px,960px,' + pos + 'px)'; var s2 = pos + 'px;top:0px;'; var s = 'clip:rect' + s1 + '; position:absolute;left:-' + s2; return s; } |
var x = document.body.scrollLeft; var y = document.body.scrollTop; |
x = document.documentElement.scrollLeft; y = document.documentElement.scrollTop; |
<style type="text/css"> div{ width:10000px; height:10000px } </style> |
<p>画面サイズ:<span id="ScrSize"></span></p> <p>ウィンドウサイズ:<span id="WinSize"></span></p> <script type="text/javascript"> window.onmouseup = mouseup; function mouseup() { //画面サイズの取得 getScreenSize(); //ウィンドウサイズの取得 getWindowSize(); } //画面サイズを取得する function getScreenSize() { var s = "横幅 = " + window.parent.screen.width + " / 高さ = " + window.parent.screen.height; document.getElementById("ScrSize").innerHTML = s; } //ウィンドウサイズを取得する function getWindowSize() { var sW,sH,s; sW = window.innerWidth; sH = window.innerHeight; s = "横幅 = " + sW + " / 高さ = " + sH; document.getElementById("WinSize").innerHTML = s; } </script> |
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript"> function openwin() { window.open("./game_bg1.html", "", "width=640,height=480"); } </script> </head> <body> <script type="text/javascript"> openwin(); </script> </body> </html> |
function changeWindow(x,y) { resizeTo(x,y); } |