调整问题...紧急! [英] resizing problem...Urgent!

查看:50
本文介绍了调整问题...紧急!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



i有一个大问题...我正在使用一个jscript来调整我所有的照片

popUp ...在主html中我有很多小照片并点击它们

它们在popUp中打开并调整到相同图片的大图。

现在,它工作正常,有时当我点击一个小小的它没有

调整大小...

这是代码:


main。 html


< a href ="#" onclick =" javascript

window.open(''/ html / popUp.html'',''Malo'',''toolbar = 0,location = 0,directori es = 0,st

atus = 0,menubar = 0,scrollbars = 0,resizable = 0''); return false;">

< IMG src =" /images/thumbs/Malo.jpg" border =" 0">

< / a>


popUp.html


< script language =" JavaScript">

var pic = new Image();

var url =''/ images / pics /''+ name +''。 JPG ''; // name =''Malo''来自main.html

pic.src = url;

函数调整大小(){

窗口。 location = url;

var wid = pic.width + 30; //有时pic.width = 0和wid = 30和

有时候还可以

var hei = pic.height + 50; //有时pic.height = 0和hei = 50和

有时候还可以

alert(" wid =" + wid +" \\\
" + hei =" + hei);

window.resizeTo(wid,hei);

}

< / script>


< / head>


< body onload =" javascript :resizing();" >


< / body>

i不知道hapens ...也许有些图片没有时间加载所以

pic.width和height是0但是当我关闭popUp并再次打开它为

相同的图片时,它的调整大小...我的意思是,调整错误的图片第二次

调整好......

如果有人知道我做错了什么帮助请!!!

非常感谢你!

Hi,
i have a big problem...i''m using one jscript for resizing of all of my pics
in popUp...in main html i''m having many little pics and clicking on them
they open in popUp and resize to larger version of the same pic.
now, it works fine and sometimes when i click on little one it doesn''t
resize well...
this is the code:

main.html

<a href="#" onclick="javascript:
window.open(''/html/popUp.html'',''Malo'',''toolbar=0,location=0,directori es=0,st
atus=0,menubar=0,scrollbars=0,resizable=0'');return false;">
<IMG src="/images/thumbs/Malo.jpg" border="0">
</a>

popUp.html

<script language="JavaScript">
var pic = new Image();
var url=''/images/pics/''+name+''.jpg''; // name=''Malo'' from main.html
pic.src = url;
function resizing(){
window.location=url;
var wid=pic.width+30; // sometimes pic.width=0 and wid=30 and
sometimes is OK
var hei=pic.height+50; // sometimes pic.height=0 and hei=50 and
sometimes is OK
alert("wid="+wid+"\n"+"hei="+hei);
window.resizeTo(wid, hei);
}
</script>

</head>

<body onload="javascript: resizing();">

</body>
i don''t know what hapens...maybe some pic doesn''t have time to load so
pic.width and height is 0 but when i close popUp and open it again for the
same pic, it resizes well...i mean, the pic that resizes wrong second time
resizes well...
If someone know what i''m doing wrong help please!!!
Thank You very much!

推荐答案

" riki" < RI ****** @ hotmail.com> schrieb im Newsbeitrag

新闻:c1 ********** @ ls219.htnet.hr ...
"riki" <ri******@hotmail.com> schrieb im Newsbeitrag
news:c1**********@ls219.htnet.hr...

我有一个很大的问题...我正在使用一个jscript来调整popUp中我所有的
图片的大小...在主要的HTML中我有很多小图片并点击它们
他们打开popUp并调整大小版本相同的图片。
现在,它工作正常,有时当我点击一个小的它没有
调整大小...
这是代码:

main.html

< a href ="#" onclick =" javascript

window.open(''/ html / popUp.html'',''Malo'',''toolbar = 0,location = 0,directori es = 0,st atus = 0,menubar = 0,scrollbars = 0,resizable = 0''); return false;">
< IMG src =" / images / thumbs / Malo.jpg" border =" 0">
< / a>

popUp.html

< script language =" JavaScript">
var pic = new Image();
var url =''/ images / pics /''+ name +''。jpg''; // name =''Malo''来自main.html
pic.src = url;
函数resizing(){
window.location = url;
var wid = pic .WIDTH + 30; //有时候pic.width = 0和wid = 30且
有时候还可以
var hei = pic.height + 50; //有时候pic.height = 0和hei = 50并且
有时候是好的
警告(" wid =" + wid +" \ n" +" hei =" + hei );
window.resizeTo(wid,hei);
}
< / script>

< / head>

< body onload =" javascript :resizing();">

< / body>

i不知道什么hapens ......也许有些pic没有时间加载所以
pic.width和height是0但是当我关闭popUp并再次打开它为
相同的图片时,它调整得很好。 ..i意思是,第二次错误调整大小的图片
调整好......
如果有人知道我做错了请帮助!!!
非常感谢你!
Hi,
i have a big problem...i''m using one jscript for resizing of all of my pics in popUp...in main html i''m having many little pics and clicking on them
they open in popUp and resize to larger version of the same pic.
now, it works fine and sometimes when i click on little one it doesn''t
resize well...
this is the code:

main.html

<a href="#" onclick="javascript:
window.open(''/html/popUp.html'',''Malo'',''toolbar=0,location=0,directori es=0,st atus=0,menubar=0,scrollbars=0,resizable=0'');return false;">
<IMG src="/images/thumbs/Malo.jpg" border="0">
</a>

popUp.html

<script language="JavaScript">
var pic = new Image();
var url=''/images/pics/''+name+''.jpg''; // name=''Malo'' from main.html
pic.src = url;
function resizing(){
window.location=url;
var wid=pic.width+30; // sometimes pic.width=0 and wid=30 and
sometimes is OK
var hei=pic.height+50; // sometimes pic.height=0 and hei=50 and
sometimes is OK
alert("wid="+wid+"\n"+"hei="+hei);
window.resizeTo(wid, hei);
}
</script>

</head>

<body onload="javascript: resizing();">

</body>
i don''t know what hapens...maybe some pic doesn''t have time to load so
pic.width and height is 0 but when i close popUp and open it again for the
same pic, it resizes well...i mean, the pic that resizes wrong second time
resizes well...
If someone know what i''m doing wrong help please!!!
Thank You very much!




抱歉,我不会评论你的剧本 - 用

调整图片大小的想法Javascript对我来说似乎很奇怪。你应该制作两个不同的

图像文件,一个用于缩略图,一个用于大视图。调整大小

图片在屏幕上看起来总是很糟糕,因为像素是内插的,甚至是b
外推。

并且:如果你增加尺寸你就不会没有足够的数据,如果你把它变成了b / b
你传输了太多数据。


-

Markus



Sorry I don''t comment your script - the idea of resizing images with
Javascript just seems very strange to me. You should make two different
image files, one for the thumbnail and one for the big view. Resized
pictures always look bad on screen, as pixels are interpolated or even
extrapolated.
And: If you increase the size you don''t have enough data, and if you make it
smaller you transfer too much data.

--
Markus


是的我有两个不同的图片文件是同一张照片...

/ images / thumbs /文件夹中的小图片文件和/ images / pics /文件夹...
yes i have two different image files of the same pic...little ones in the
/images/thumbs/ folder and big ones in the /images/pics/ folder...


实际上我正在尝试将html popUp窗口调整为widht和高度

在其中打开的照片尺寸...

我不是要尝试调整acctuall图片本身的大小
acctually i''m trying to resize html popUp window to the widht and height of
the pics dimension that opens in it...
i''m not trying to resize the acctuall pic itself


这篇关于调整问题...紧急!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆