1.js
次のようにコードをコピーします。
<script type="text/javascript">
関数 openwindow(url,name,iWidth,iHeight)
{
// URL は Web ページのアドレスにリダイレクトされます
// Web ページ名を指定します。空でも構いません
// iWidth ポップアップウィンドウの幅
// iHeight ポップアップ ウィンドウの高さ
//window.screen.height は画面の高さを取得し、window.screen.width は画面の幅を取得します
var iTop = (window.screen.height-30-iHeight)/2; //ウィンドウの垂直位置を取得します。
var iLeft = (window.screen.width-10-iWidth)/2; // ウィンドウの水平位置を取得します。
window.open(url,name,'height='+iHeight+',,innerHeight='+iHeight+',width='+iWidth+',innerWidth='+iWidth+',top='+iTop+',left='+iLeft+ ',toolbar=no,menubar=no,scrollbars=auto,resizeable=no,location=no,status=no');
}
</script>
2.呼び出し方法
次のようにコードをコピーします。
<a href="javascript:void(0);" onclick="javascript:openwindow('a.html','',400,200);">次の場所に移動します</a>