使PopUp窗口帮助居中 [英] Centering a PopUp Window Help
问题描述
我想在Dreamweaver扩展程序中添加/修改以下代码
Open Picture Window Fever能够使PopUp窗口居中:
默认情况下,它允许窗口在左侧和顶部偏移,但是
不包括居中选项。
我想它会包含类似(screen.width-imageWidth)/ 2的东西;
某处但不确定怎么办关于这样做。
感谢您的帮助!
______________
功能
openPictureWindow_Fever(imageType,imageName,imageW width,imageHeight,alt,posle
ft,posTop){// v4.01
newWindow =
window.open(""," newWindow"," width =" + imageWidth +",h eight =" + imageHeight +" ;,scro
llbars = no,left =" + posLeft +",top =" + posTop);
newWindow.document.open();
newWindow.document .write(''< html>< title>''+ alt +''< / title>< body
bgcolor =" #FFFFFF" leftmargin =" 0" to pmargin = QUOT; 0" marginheight =" 0"
marginwidth =" 0" onBlur =" self.close()">'');
if(imageType ==" swf"){
newWindow。 document.write(''< object
classid = \" clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 \"
codebase = \ " http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c
ab#version = 5,0,0,0\" width = \ "''+ imageWidth +''\" height = \"''+ imageHeight +''\">'');
newWindow.document.write('' < param name = movie value = \"''+ imageName +''\">< param
name = quality value = high>'');
newWindow.document.write(''< embed src = \"''+ imageName +''\'" quality = high
pluginspage = \" http: //www.macromedia.com/shockwave/download/index.cgi?P1_Prod
_Version = ShockwaveFlash \" type = \" application / x-shockwave-flash \"
width = \"''+ imageWidth +''\" height = \"''+ imageHeight +''\">'');
newWindow.document.write(''< / embed>< / object>''); } else {
newWindow.document.write(''< img src = \"''+ imageName +''\" width =''+ imageWidth +''
height =''+ imageHeight +''alt = \"''+ alt +''\">''); }
newWindow.document.write(''< / body>< / html>'');
newWindow.document.close();
newWindow.focus();
}
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
openPictureWindow_Fever(imageType,imageName,imageW idth,imageHeight,alt,posLe
ft,posTop) { // v4.01
newWindow =
window.open("","newWindow","width="+imageWidth+",h eight="+imageHeight+",scro
llbars=no,left="+posLeft+",top="+posTop);
newWindow.document.open();
newWindow.document.write(''<html><title>''+alt+''</title><body
bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0"
marginwidth="0" onBlur="self.close()">'');
if (imageType == "swf"){
newWindow.document.write(''<object
classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"
codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=5,0,0,0\" width=\"''+imageWidth+''\" height=\"''+imageHeight+''\">'');
newWindow.document.write(''<param name=movie value=\"''+imageName+''\"><param
name=quality value=high>'');
newWindow.document.write(''<embed src=\"''+imageName+''\" quality=high
pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod
_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\"
width=\"''+imageWidth+''\" height=\"''+imageHeight+''\">'');
newWindow.document.write(''</embed></object>''); }else{
newWindow.document.write(''<img src=\"''+imageName+''\" width=''+imageWidth+''
height=''+imageHeight+'' alt=\"''+alt+''\">''); }
newWindow.document.write(''</body></html>'');
newWindow.document.close();
newWindow.focus();
}
推荐答案
Applebrownbetty写道:
Applebrownbetty wrote:
我想从Dreamweaver扩展中追加/修改以下代码
打开图片窗口热能够使PopUp窗口居中:
抛弃并重新开始。
默认情况下,它允许窗口在左侧和顶部偏移,但不包括居中选项。
不,它只是认为它可以抵消我PC上的窗口。
我想它会包含类似的内容(screen.width-imageWidth) / 2;
在某个地方,但不知道如何去做这件事。
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:
Ditch it and start over.
By default, it allows the window to be offset on the left and top, but does
not include a centering option.
Nah, it just thinks it can offset windows on my PC.
I''m thinking it would include something like (screen.width-imageWidth)/2;
somewhere but not sure how do go about doing this.
首先,问问自己是什么让任何人认为我想要一个弹出窗口
位于我桌面的中心?我的桌面宽度为2560像素,因此弹出窗口会坐在(或试图坐在)两个显示器之间。
打开一个窗口,让*用户*决定把它放在哪里。
-
兰迪
comp.lang.javascript常见问题 - http://jibbering.com/faq
Randy Webb写道:
Randy Webb wrote:
打开一个窗口,让*用户*决定把它放在哪里。
Open a window, let the *user* decide where to put it.
嗯,打开一个窗口[1],然后让用户可能非常合理的
窗口管理器处理它(并让用户从那里移动它,如果他们像
那样)
[1]或者不要 - 感谢弹出窗口拦截器和人们只是在内容加载之前自己训练
来打X,他们并不是完全
这些天有效。
-
David Dorward< http://blog.dorward.me.uk/> ; < http://dorward.me.uk/>
首页是〜/ .bashrc
Well, open a window[1], then let the user''s probably-pretty-reasonable
window manager deal with it (and let the user move it from there if they
like)
[1] Or don''t - thanks to popup blockers and people simply training
themselves to hit the X before the content loads, they aren''t exactly
effective these days.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
" Randy Webb" ; <您好************ @ aol.com>在消息中写道
新闻:5P ******************** @ comcast.com ...
"Randy Webb" <Hi************@aol.com> wrote in message
news:5P********************@comcast.com...
Applebrownbetty写道:
Applebrownbetty wrote:
我想从Dreamweaver
扩展名Open Picture Window Fever中追加/修改以下代码;为了能够使PopUp窗口居中:
抛弃它并重新开始。
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:
Ditch it and start over.
为什么?
Why?
By默认情况下,它允许窗口在左侧和顶部偏移,但
不包括居中选项。
Nah,它只是认为它可以抵消我PC上的窗口。
By default, it allows the window to be offset on the left and top, but does not include a centering option.
Nah, it just thinks it can offset windows on my PC.
显然你的意思是......但缺乏时间/精力/耐心
直接写出来(在这种情况下你不应该发布它) ),所以我会跳过
吧。
Obviously you mean something here... but lack the time/energy/patience to
write it outright (in which case you shouldn''t have posted it), so I''ll skip
it.
我在想它会包括比如
(screen.width-imageWidth)/ 2;在某个地方,但不知道如何去做。
I''m thinking it would include something like (screen.width-imageWidth)/2; somewhere but not sure how do go about doing this.
首先,问问自己是什么让任何人认为我想要一个弹出窗口
在中心我的桌面?
我的答案是它是一个放大的缩略图,在一个大桌面上它会意味着如果它靠近中心的话,那么鼠标移动就会减少
缩略图与左下角相对,其中大部分弹出窗口。
我的桌面宽度为2560像素,所以弹出窗口会坐下(或尝试坐在两个
监视器之间。
您所处情况的人的百分比是多少?是的,不到0.5%我会猜测
。这可能是一个问题,如果你自己无法移动它...
但即使它在中心,你也可以。
打开一个窗口,让*用户*决定把它放在哪里。
无论是在左上角还是中间打开,它都会让用户决定把它放在哪里,因为它是可移动的。我的目标是为用户创造最少的挫折
。当他们点击图像并且它在附近弹出时,那就是用户友好的并且看起来比大的
监视器左上角的图像看起来更好IMO 。它的框架更好。
-
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
这篇关于使PopUp窗口帮助居中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!