Javascript code
<script type="text/javascript"> function popup(url,name,windowWidth,windowHeight){ myleft=(screen.width)?(screen.width-windowWidth)/2:100; mytop=(screen.height)?(screen.height-windowHeight)/2:100; properties = "width="+windowWidth+",height="+windowHeight; properties +=",scrollbars=yes, top="+mytop+",left="+myleft; window.open(url,name,properties); } </script>
HTML code
<a href="javascript:popup('http://www.google.com','',400,400)" >เปิด google.com แบบ popup </a>
ตัวอย่างผลลัพธ์
เปิด google.com แบบ popup