HighDots Forums  

center popup FROM the onClick event?...

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss center popup FROM the onClick event?... in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
seb
 
Posts: n/a

Default center popup FROM the onClick event?... - 06-14-2004 , 11:31 AM






Hi all,
I'm opening popup windows with the following script:

onClick =
'javascript:n_name=window.open('page.html','','hei ght=640,width=895,scrollbars=no,toolbar=no,menubar =no');void(0);")'

I want to center the popups, and I know how to do it with an onLoad
script I would place in the the popup page. But is there a way to place
the script within the onclick event (within the above script) rather
than in the popup html?

Thanks

Reply With Quote
  #2  
Old   
Mick White
 
Posts: n/a

Default Re: center popup FROM the onClick event?... - 06-15-2004 , 09:13 PM






onClick =
"n_name = window.open('page.html','','height=640,width=895,t op='+
Math.round((screen.height-640)/2)+',left='+Math.round((screen.width-895)/2))"

Very crude, though. Especially if screen size is less than 895x640 (very
possible), top and left will be negative(not good).

If you are interested, I will show you how to check for these possibilities.
MIck

seb wrote:

Quote:
Hi all,
I'm opening popup windows with the following script:

onClick =
'javascript:n_name=window.open('page.html','','hei ght=640,width=895,scrollbars=no,toolbar=no,menubar =no');void(0);")'


I want to center the popups, and I know how to do it with an onLoad
script I would place in the the popup page. But is there a way to place
the script within the onclick event (within the above script) rather
than in the popup html?

Thanks

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.