TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Popup Window in JavaScript
Raghubir Kumar
May 18, 2020
4.9
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
JavaScript to adjust the popup window.
<script type=
"text/javascript"
>
function
popupwindow(w, h) {
var
ctrl =
'<%=txtDate.ClientID.Trim() %>'
;
var
ddlCtrl = document.getElementById(
'<%=ddlDepartment.ClientID %>'
);
wLeft = window.screenLeft ? window.screenLeft : window.screenX;
wTop = window.screenTop ? window.screenTop : window.screenY;
var
left = wLeft + (window.innerWidth / 2) - (w / 2);
var
top = wTop + (window.innerHeight / 2) - (h / 2);
return
window.open(
'frmapontcalander.aspx?ctrl='
+ ctrl +
'&Dept='
+ ddlCtrl.value,
'Hei'
,
'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=500, height=300, top=100, left='
+ left +
', screenX='
+ left +
', screenY='
+ top);
}
</script>
Popup window
Next Recommended Reading
Javascript-Open new Popup Window on button click event