<script type="text/javascript"> window._win = document.createElement('div'); _win.setAttribute('id','_win') _win.style.position='absolute'; _win.style.width='0px'; _win.style.height='0px'; _win.style.left='0px'; _win.style.top='0px'; _win.style.color = '#000000'; _win.style.backgroundColor = '#E0E0E0'; _win.style.display = 'none'; _win.style.borderStyle = 'solid'; _win.style.borderColor = '#303030'; _win.style.borderWidth = '1px'; _win.style.display = 'none'; str=""; str+="<input \n"; str+=" type=\"image\" \n"; str+=" src=\"http://winofsql.jp/image/mcancel.png\" \n"; str+=" style='float:right' \n"; str+=" onClick='this.parentNode.style.display = \"none\";' \n"; str+="> \n"; str+=" "; _win.innerHTML = str; document.body.appendChild(_win); function setWin(target,x,y,w,h) { var numY = target.offsetTop; var numX = target.offsetLeft; var obj = target; while( obj = obj.offsetParent ) { numY += obj.offsetTop; numX += obj.offsetLeft; if ( obj.tagName == 'BODY' ) { break; } } _win.style.top = (numY+y) + "px"; _win.style.left = (numX+x) + "px"; _win.style.width = w + "px"; _win.style.height = h + "px"; _win.style.display = ""; } </script> <input type="button" value="ウインドウを開く" onClick='setWin(this,0,this.offsetHeight+2,200,150)' >
|