เอาไว้สำหรับเปิดหน้าใหม่ เป็น popup ลองเอาไปใช้ดูนะครับ
โค้ด: เลือกทั้งหมด
function popup(url,name,windowWidth,windowHeight){
myleft=(screen.width)?(screen.width-windowWidth)/2:100;
mytop=(screen.height)?(screen.height-windowHeight)/1.5:100;
properties = "width="+windowWidth+",height="+windowHeight;
properties +=",scrollbars=yes, top="+mytop+",left="+myleft;
window.open(url,name,properties);
}