Forums
This topic is locked
pop un center screen
Posted 09 May 2003 22:12:57
1
has voted
09 May 2003 22:12:57 shai navon posted:
I am looking to create a site that will pop up a window in the middle of the visitors screen . how do i indicate that I want the pop up to pop up in the center of the veiwer's screen ?? an exampl to this type of site is www.walterbeasley.com .thanks .
Replies
Replied 09 May 2003 22:27:09
09 May 2003 22:27:09 yeca yeca replied:
this is the javascript code for this :
<pre id=code><font face=courier size=2 id=code> <script language="Javascript"> function fenCentre(url,largeur,hauteur){ var Dessus=(screen.height/2)-(hauteur/2); var Gauche=(screen.width/2)-(largeur/2); var features= 'height='+hauteur+',width='+largeur+',top='+Dessus +',left='+Gauche+",scrollbars=yes"; thewin=window.open(url,'',features); } </script> </font id=code></pre id=code>
and for the link :
<pre id=code><font face=courier size=2 id=code> <a href=javascript:fenCentre("yourpage.htm",300,300)>open popup </a> </font id=code></pre id=code>
<pre id=code><font face=courier size=2 id=code> <script language="Javascript"> function fenCentre(url,largeur,hauteur){ var Dessus=(screen.height/2)-(hauteur/2); var Gauche=(screen.width/2)-(largeur/2); var features= 'height='+hauteur+',width='+largeur+',top='+Dessus +',left='+Gauche+",scrollbars=yes"; thewin=window.open(url,'',features); } </script> </font id=code></pre id=code>
and for the link :
<pre id=code><font face=courier size=2 id=code> <a href=javascript:fenCentre("yourpage.htm",300,300)>open popup </a> </font id=code></pre id=code>