「Click me」のボタンを押すと、画面の中央に別ウインドウが開いて写真が表示されます。


<HTML>
<HEAD>
<TITLE>Change the message at time3</TITLE>
<SCRIPT TYPE="text/javascript">
<!--
  var gWindowWidth = 220;
  var gWindowHeight = 220;
  function WinOpen() {
    var st = 'width=' + gWindowWidth;
    st += ',';
    st += 'height=' + gWindowHeight;
    st += ',';
   var cw = (screen.width / 2) - (gWindowWidth / 2);
   var ch = (screen.height / 2) - (gWindowHeight / 2);
    if (navigator.userAgent.indexOf('MSIE') != -1) {
      st += 'left=' + cw;
      st +=',';
      st += 'top=' + ch;
    }
    else if (navigator.userAgent.indexOf('Mozilla') != -1) {
      st += 'screenX=' + cw;
      st += ',';
      st += 'screenY=' + ch;
    }
    window.open('image/morn.jpg', '', st);
//-->
</SCRIPT>
</HEAD>
<BODY>
<INPUT TYPE="button" VALUE="Click me" onClick="WinOpen()">
</BODY>
</HTML>

BACK