<html>
<head><title>てすと</title>
<SCRIPT Language="JavaScript">
<!--
var xpos = new Array(3); // コメントのX座標
var ypos = new Array(3); // コメントのy座標
var hi = new Array(3); // コメント幅
var wid = new Array(3); // コメント高さ
var chk = new Array(3); // 選択されているかどうか
function Load()
{
xpos[0] = 0;
xpos[1] = 0;
xpos[2] = 0;
ypos[0] = 100;
ypos[1] = 200;
ypos[2] = 300;
wid[0] = 100;
wid[1] = 100;
wid[2] = 100;
hi[0] = 20;
hi[1] = 20;
hi[2] = 20;
chk[0] = 0;
chk[1] = 0;
chk[2] = 0;
}
function mdown()
{
nowx = event.clientX;
nowy = event.clientY;
for ( i = 0 ; i < 3 ; i ++ )
{
if( ( xpos[i] <= nowx ) && ( xpos[i]+wid[i] >= nowx ) &&
( ypos[i] <= nowy ) && ( ypos[i]+hi[i] >= nowy ) )
{
if ( chk[i] == 0 )
{
chk[i] = 1;
chgclr(i,"blue");
}
else
{
chk[i] = 0;
chgclr(i,"red");
}
}
}
}
function chgclr(pos,col)
{
switch(pos)
{
case 0:
div11.style.backgroundColor = col;
break;
case 1:
div12.style.backgroundColor = col;
break;
case 2:
div13.style.backgroundColor = col;
break;
}
}
// -->
</SCRIPT>
</head>
<body onload="Load()">
<div id=div1 style="position:absolute;top:0;left:0;width:500;height:500;x-index:1;" onMouseDown="mdown()">
<iframe src="http://slashdot.jp/it/08/06/06/0719236.shtml" scrolling="no" width="500" height="500">
</iframe>
<div id=div11 style="position:absolute;x-index:2;left:0;top:100;width:100;height:20;background-color:red;">
コメント1
</div>
<div id=div12 style="position:absolute;x-index:2;left:0;top:200;width:100;height:20;background-color:red;">
コメント2
</div>
<div id=div13 style="position:absolute;x-index:2;left:0;top:300;width:100;height:20;background-color:red;">
コメント3
</div>
</div>
</body>
</html>
|