<!DOCTYPE html>
<html>
<head>
<title>Show popup in the center of the user screen</title>
</head>
<body>
<button onclick="show_pop()">Open</button>
<script>
function show_pop(){
var screen_widht = window.screen.width;
var screen_height = window.screen.height;
var popup_width = 800;
var popup_height = 500;
var top = (screen_height/2)-(popup_height/2);
var left = (screen_widht/2)-(popup_width/2);
window.open("https://google.com","","width="+popup_width+",height="+popup_height+",top="+top+",left="+left);
}
</script>
</body>
</html>
More
Publish A Comment