「javascript入門」ウィンドウを画面中央に表示する方法
<script language="javascript">
function openWin(u, w, h) {
var l = (screen.width – w) / 2;
var t = (screen.height – h) / 2;
var s = 'width=’ + w + ', height=’ + h + ', top=’ + t + ', left=’ + l;
s += ', toolbar=no, scrollbars=no, menubar=no, location=no, resizable=no’;
open(u, 'oWin’, s);
}
</script>
<a href="javascript:void(openWin('http://www.sample.com/’, 600, 500));">demo</a>