Windowに閉じるボタンを設置し、ボタンクリックでWindowを閉じる
1 2 3 4 |
<!-- HTML 表記 --> <form name="form1"> <input type="button" id="bt1" value="サンプル画面開く" onClick="winopen('c02_photo1.html')"> </form> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
// JavaScript 表記 <script type="text/javascript"> <!-- function winclose(){self.close();} //--> </script> <script type="text/javascript"> <!-- function winopen(photo){ win1=window.open(photo,"","width=500,height=420"); posX=screen.width/2-250; posY=screen.height/2-300; win1.moveTo(posX,posY); } //--> </script> |