Created
October 31, 2013 05:03
-
-
Save ihsanberahim/7244599 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<button onclick="javascript:popup('http://google.com','test',600,400)">Open</button> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function popup(_url,_windowName,_width,_height) { | |
var left = (screen.width/2)-(_width/2); | |
var top = (screen.height/2)-(_height/2); | |
var params = [ | |
'resizable=yes', | |
'scrollbars=yes', | |
'toolbar=no', | |
'menubar=no', | |
'location=no', | |
'directories=no', | |
'status=yes', | |
'width='+_width, | |
'height='+_height, | |
'top='+top, | |
'left='+left | |
]; | |
window.open(_url,_windowName,params.join(',')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment