Click to See Complete Forum and Search --> : Auto-centering popup js


CDiBB
07-29-2003, 11:34 AM
Can someone help me to change the following code? I would like the popup window to come up with no margins, so the photo fits perfectly inside the window. Can you help, please?

Original code as I received it:

ADD TO <HEAD>

<script language="javascript">

/*
Auto center window script- Eric King (http://redrival.com/eak/index.shtml)
Permission granted to Dynamic Drive to feature script in archive
For full source, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

var win = null;
function NewWindow(mypage,myname,w,h,scroll){
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+',scrollbars='+scroll+',resizable'
win = window.open(mypage,myname,settings)
}

</script>

ADD TO EACH LINK THE RED PORTION

<a href="http://wsabstract.com" onclick="NewWindow(this.href,'name','400','400','yes');return false">Website Abstraction</a>


Thanks for your help,
:confused: :) onclick="NewWindow(this.href,'name','400','400','yes');return false">

pyro
07-29-2003, 11:38 AM
Take a look at http://www.infinitypages.com/research/imagepopup.htm

CDiBB
07-29-2003, 12:19 PM
That works well, can't seem to get it centered, but that's ok.

Thanks for your help.
:D