Web
Expertsforge
Home
FREE Signup
Login
Search
Advertise
Link to Us
Contact Us
Help
Login:
Home
» Categories |
Web Development
»
JavaScript
» View Tutorial
JavaScript Tutorial: Opening a New window Centered on the Screen using Javascript
jawahar
8/28/2005 11:38:58 PM, Views: 2288
Have the following code to load the filename.html open centered in
the screen.
Remember : please have any .html file named as filename.html where
the following file is,
<html><head>
<script language=javascript>
function openWinCenter()
{
leftPos = 0
topPos = 0
if (screen)
{
leftPos = (screen.width / 2) - 251
topPos = (screen.height / 2) - 162
}
ElementWindow = window.open
('filename.html','WinTitle','width=502,height=325,left='+leftPos+',to
p='+topPos)
}
</script>
</head><body>
The function call within the anchor is simple on this one:
<a href="javascript:openWinCenter()">Click to View a Window aligned
Centered!</a>
</body>
</html>
Next Steps:
Add this Tutorial to:
Blink
Del.icio.us
Digg
Fark
Furl
Google
Reddit
Simpy
Spurl
Technorati
Win Live
Yahoo
Rate Me!
Avg Visitor Rating:
Number of Ratings : 3 Votes
Rate:
Select Your Rating
Excellent!
Very Good
Good
Fair
Poor
Send Message
Signup
/
Login
To View the Solution or Provide Comments
Post Comment/Solution
Comment:*
(Link Rules)
Use :
[bold] for <b>; [/bold] for </b>; [italic] for <i>; [/italic] for </i>; [code] & [/code] for code
Categories
Applications
Operating Systems
Databases
Programming
Web Development
Networking
Security
Hardware
Search Engine Optimization
Make Money Online
Miscellaneous
Options
Submit a Tutorial
Ask a Question
Add to KB
Join as a Moderator?
Most Popular Tutorial
1.
InStr in JavaScript
2.
Mid() function in Ja...
3.
Capturing Mouse Posi...
4.
Setting IFRAME heigh...
5.
Javascript Input Box...
6.
Validating a text bo...
7.
Dynamically create/a...
8.
JavaScript Trim Func...
9.
Creating floating me...
10.
Left() function in J...
Most Popular Solution
1.
How to reload a fram...
Top Rated
1.
InStr in JavaScript
2.
Mid() function in Ja...
3.
Capturing Mouse Posi...
4.
Validating a text bo...
5.
Javascript Input Box...
6.
Dynamically create/a...
7.
Dynamically changing...
8.
Creating a Message B...
9.
JavaScript Trim Func...
10.
Left() function in J...
Top Rankers
Overall
1. jawahar (1400)
Yearly -2008
1. jawahar (200)
Expertsforge Sponsors
1.
Recover deleted files
FREE Signup
Advertise
Link to Us
Contact Us
Sitemap
Tutorial Sitemap
About Us
Privacy Policy
Copyright 2004 - 2008 Expertsforge.com