Why Register With OSV?

Join 5700+ of your peers

Get enriched. Access 1270+ quality tutorials right away on:

  • Joomla 2.5.X, 3.0.X
  • WordPress 3.5.X
  • Shopping Carts
  • E-Commerce Payment Gateways
  • PDFs for each tutorial - FREE for download
  • New topics and tutorials added weekly

FREE EBooks

FREE Templates

Member Login

Not a member yet? Sign Up!

Opensourcevarsity Logo
Tutorials & Training from experienced world class trainers
Welcome, Guest
Username Password: Remember me

I use javascript to open a new window
(1 viewing) (1) Guest
All your queries regarding JavaScript will be solved in this forum
  • Page:
  • 1

TOPIC: I use javascript to open a new window

I use javascript to open a new window 10 months, 1 week ago #1387

  • avan12
  • OFFLINE
  • Senior Boarder
  • Posts: 76
  • Karma: 0
"I use javascript to open a new window

window.open(URL,Name,""width=400, height=400"");

How to put the window in the middle of screen?(If I use top,left by pixel,

the window is not in center if screen mode changes)

Can anyone help?Thanx in advance.
"

Re: I use javascript to open a new window 10 months, 1 week ago #1391

  • suny
  • OFFLINE
  • Senior Boarder
  • Posts: 50
  • Karma: 0
"<s-cript type=""text/j-avascript"">
function NewWindow(mypage,myname,w,h)
{
LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
settings

='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+','
win = window.open(mypage,myname,settings)
if(win.window.focus){win.window.focus();}
}
</script>

<button on-click=""NewWindow('www.google.com/','Name',400,400);"">New

Centered Window</button>"
  • Page:
  • 1
Time to create page: 1.26 seconds
O-S-V Free Templates

FREE HTML / Joomla / WordPress Templates For Download
Registration Required

CONNECT WITH US

Sitemap   |   Privacy Policy   |   MySQL(70)   |   Disclaimer   |   Reach Out To Us
Designed by Ivan Bayross & Meher Bala | Powered by Joomla
© 2013 All Rights Reserved.