Javascript code
1 2 3 4 5 6 7 8 9 | < 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
1 |
ตัวอย่างผลลัพธ์
เปิด google.com แบบ popup