<script>
var win = null;
function popupwindow(filename, windowname, w, h) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += 'resizable=0, scrollbars=0, status=0,toolbar=0, menubars=0, location=0';
win = window.open('./'+filename, windowname, settings);
win.window.focus();
}
</script>
var win = null;
function popupwindow(filename, windowname, w, h) {
var winl = (screen.width-w)/2;
var wint = (screen.height-h)/2;
if (winl < 0) winl = 0;
if (wint < 0) wint = 0;
var settings = 'height=' + h + ',';
settings += 'width=' + w + ',';
settings += 'top=' + wint + ',';
settings += 'left=' + winl + ',';
settings += 'resizable=0, scrollbars=0, status=0,toolbar=0, menubars=0, location=0';
win = window.open('./'+filename, windowname, settings);
win.window.focus();
}
</script>
อันนี้วิธีใช้ครับ
<script>popupwindow("test.php?xxx=xx", "_blank", 200,
300)</script>
ไม่มีความคิดเห็น:
แสดงความคิดเห็น