Hi,
I'd like to append/amend the following code from the Dreamweaver extension
"Open Picture Window Fever" for the ability to center the PopUp window:
By default, it allows the window to be offset on the left and top, but does
not include a centering option.
I'm thinking it would include something like (screen.width-imageWidth)/2;
somewhere but not sure how do go about doing this.
Thanks for any help!
______________
function
openPictureWind ow_Fever(imageT ype,imageName,i mageWidth,image Height,alt,posL e
ft,posTop) { // v4.01
newWindow =
window.open("", "newWindow","wi dth="+imageWidt h+",height="+im ageHeight+",scr o
llbars=no,left= "+posLeft+",top ="+posTop);
newWindow.docum ent.open();
newWindow.docum ent.write('<htm l><title>'+alt+ '</title><body
bgcolor="#FFFFF F" leftmargin="0" topmargin="0" marginheight="0 "
marginwidth="0" onBlur="self.cl ose()">');
if (imageType == "swf"){
newWindow.docum ent.write('<obj ect
classid=\"clsid :D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=5,0, 0,0\" width=\"'+image Width+'\" height=\"'+imag eHeight+'\">');
newWindow.docum ent.write('<par am name=movie value=\"'+image Name+'\"><param
name=quality value=high>');
newWindow.docum ent.write('<emb ed src=\"'+imageNa me+'\" quality=high
pluginspage=\"h ttp://www.macromedia. com/shockwave/download/index.cgi?P1_Pr od
_Version=Shockw aveFlash\" type=\"applicat ion/x-shockwave-flash\"
width=\"'+image Width+'\" height=\"'+imag eHeight+'\">');
newWindow.docum ent.write('</embed></object>'); }else{
newWindow.docum ent.write('<img src=\"'+imageNa me+'\" width='+imageWi dth+'
height='+imageH eight+' alt=\"'+alt+'\" >'); }
newWindow.docum ent.write('</body></html>');
newWindow.docum ent.close();
newWindow.focus ();
}
I'd like to append/amend the following code from the Dreamweaver extension
"Open Picture Window Fever" for the ability to center the PopUp window:
By default, it allows the window to be offset on the left and top, but does
not include a centering option.
I'm thinking it would include something like (screen.width-imageWidth)/2;
somewhere but not sure how do go about doing this.
Thanks for any help!
______________
function
openPictureWind ow_Fever(imageT ype,imageName,i mageWidth,image Height,alt,posL e
ft,posTop) { // v4.01
newWindow =
window.open("", "newWindow","wi dth="+imageWidt h+",height="+im ageHeight+",scr o
llbars=no,left= "+posLeft+",top ="+posTop);
newWindow.docum ent.open();
newWindow.docum ent.write('<htm l><title>'+alt+ '</title><body
bgcolor="#FFFFF F" leftmargin="0" topmargin="0" marginheight="0 "
marginwidth="0" onBlur="self.cl ose()">');
if (imageType == "swf"){
newWindow.docum ent.write('<obj ect
classid=\"clsid :D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http ://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=5,0, 0,0\" width=\"'+image Width+'\" height=\"'+imag eHeight+'\">');
newWindow.docum ent.write('<par am name=movie value=\"'+image Name+'\"><param
name=quality value=high>');
newWindow.docum ent.write('<emb ed src=\"'+imageNa me+'\" quality=high
pluginspage=\"h ttp://www.macromedia. com/shockwave/download/index.cgi?P1_Pr od
_Version=Shockw aveFlash\" type=\"applicat ion/x-shockwave-flash\"
width=\"'+image Width+'\" height=\"'+imag eHeight+'\">');
newWindow.docum ent.write('</embed></object>'); }else{
newWindow.docum ent.write('<img src=\"'+imageNa me+'\" width='+imageWi dth+'
height='+imageH eight+' alt=\"'+alt+'\" >'); }
newWindow.docum ent.write('</body></html>');
newWindow.docum ent.close();
newWindow.focus ();
}
Comment