โดย mindphp » 28/07/2010 3:30 am
Javascript เปิดหน้าใหม่ แบบ popup พร้อมทั้งใส่ properties ให้ windown ใหม่
เอาไว้สำหรับเปิดหน้าใหม่ เป็น 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);
}
[b]Javascript เปิดหน้าใหม่ แบบ popup พร้อมทั้งใส่ properties ให้ windown ใหม่ [/b]
เอาไว้สำหรับเปิดหน้าใหม่ เป็น popup ลองเอาไปใช้ดูนะครับ
[code]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);
} [/code]