没有javascript的图像预览器代码 [英] Image Previewer code without javascript

查看:85
本文介绍了没有javascript的图像预览器代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想查找可点击缩略图的代码,当点击小的
图片时,会在新窗口中弹出一个大图片,大小适合图片。

与标准相同javascript图片预览器,但没有使用

javascript。我想尝试用html做这个,这个工作在

浏览器上禁用了javascript。


我尝试了以下内容,但它仍然需要启用javascript显示

弹出窗口调整大小以适应图像,否则它打开一个全屏窗口。


< a href =" big.jpg" ONCLICK =" if(window.open){window.open''big.jpg'',

''popup'',''滚动条,可调整大小,宽度= 800,高度= 600' );返回

false; }">< img src =" small.jpg" ALT ="点击放大">< / a>

问候。

I want find code for clickable thumbnails, when click on small
picture, a big image will popup in new window, sized to fit picture.
Same as standard javascript image previewer, but without using
javascript. I want try do this with html only, that this work on
browsers with javascript disabled.

I tried the following, but it still require javascript enabled to show
popup resized to fit image, otherwise it open a fullscreen window.

<a href="big.jpg" ONCLICK="if (window.open) { window.open ''big.jpg'',
''popup'', ''scrollbars,resizable,width=800,height=600''); return
false; }"><img src="small.jpg" ALT="Click to enlarge"></a>
Regards.

推荐答案

mistral于2007年15月15日在comp.lang.javascript中写道
mistral wrote on 15 mrt 2007 in comp.lang.javascript:

我希望找到可点击缩略图的代码,点击小

图片,一个大图片将在新窗口中弹出,大小适合图片。

与标准的javascript图片预览器相同,但不使用

javascript。我想尝试用html做这个,这个工作在

浏览器上禁用了javascript。


我尝试了以下内容,但它仍然需要启用javascript显示

弹出窗口调整大小以适应图像,否则它打开一个全屏窗口。


< a href =" big.jpg" ONCLICK =" if(window.open){window.open''big.jpg'',

''popup'',''滚动条,可调整大小,宽度= 800,高度= 600' );返回

false; }">< img src =" small.jpg" ALT =点击放大>< / a>
I want find code for clickable thumbnails, when click on small
picture, a big image will popup in new window, sized to fit picture.
Same as standard javascript image previewer, but without using
javascript. I want try do this with html only, that this work on
browsers with javascript disabled.

I tried the following, but it still require javascript enabled to show
popup resized to fit image, otherwise it open a fullscreen window.

<a href="big.jpg" ONCLICK="if (window.open) { window.open ''big.jpg'',
''popup'', ''scrollbars,resizable,width=800,height=600''); return
false; }"><img src="small.jpg" ALT="Click to enlarge"></a>



如果你不想要javascript,你为什么要问这个NG?


你问屠夫一个素食?


-

Evertjan。

荷兰。

(请更改x''es到我的电子邮件地址中的点数)

If you do not want javascript, why are you asking on this NG?

Do you ask the butcher for a vegetarian diet?

--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


3月15日上午10点36分,迷雾 < polych ... @softhome.netwrote:
On Mar 15, 10:36 am, "mistral" <polych...@softhome.netwrote:

我尝试了以下内容,但仍然需要启用javascript才能显示

popup resized以适应图像,否则它打开一个全屏窗口。
I tried the following, but it still require javascript enabled to show
popup resized to fit image, otherwise it open a fullscreen window.



你不能在不使用JavaScript的情况下设置窗口的大小。如果它是我的b $ b,我会考虑这样一个事实:当

JS关闭时,窗口没有调整大小,以便优雅降级。我会发现

可以接受。


您是否考虑在DIV中弹出大图像,而不是

在新窗口?如果是这样,那么你可以使用:hover伪类提出一个纯CSS

2解决方案。如果你有一些CSS下降 -

下来的菜单代码,我想你可以将

重新用于合理的图像查看器。

You can''t set the size of a window without using JavaScript. If it
were me, I would consider the fact that the window isn''t resized when
JS is off, to be "graceful degradation," and I would find it
acceptable.

Would you consider having the large image pop up in a DIV, instead of
in a new window? If so then you can probably come up with a pure CSS
2 solution using the :hover pseudo-class. If you have some CSS drop-
down menu code lying around, I would imagine you can repurpose that
into a reasonable image viewer.


15岁,17:17,Noah Sussman < blink ... @ gmail.comwrote:
On 15 íáò, 17:17, "Noah Sussman" <blink...@gmail.comwrote:

3月15日上午10点36分,迷雾 < polych ... @softhome.netwrote:
On Mar 15, 10:36 am, "mistral" <polych...@softhome.netwrote:

我尝试了以下内容,但仍然需要启用javascript才能显示

popup resized以适应图像,否则它打开一个全屏窗口。
I tried the following, but it still require javascript enabled to show
popup resized to fit image, otherwise it open a fullscreen window.



你不能在不使用JavaScript的情况下设置窗口的大小。如果它是我的b $ b,我会考虑这样一个事实:当

JS关闭时,窗口没有调整大小,以便优雅降级。我会发现

可以接受。


您是否考虑在DIV中弹出大图像,而不是

在新窗口?如果是这样,那么你可以使用:hover伪类提出一个纯CSS

2解决方案。如果你有一些CSS drop-

下来的菜单代码,我想你可以将

重新用于合理的图像查看器。


You can''t set the size of a window without using JavaScript. If it
were me, I would consider the fact that the window isn''t resized when
JS is off, to be "graceful degradation," and I would find it
acceptable.

Would you consider having the large image pop up in a DIV, instead of
in a new window? If so then you can probably come up with a pure CSS
2 solution using the :hover pseudo-class. If you have some CSS drop-
down menu code lying around, I would imagine you can repurpose that
into a reasonable image viewer.



------------


我没有反对javscript,但有些网站没有不允许脚本,

和一些浏览器可能阻止它。例如,eBay阻止他们的列表生成器中的
脚本。我们仍然可以使用JavaScript设置没有

的窗口大小。我有一个这样的代码的样本,但是找不到它,

在某个地方丢失了。

------------

I have nothing against javscript, but some sites do not allow scripts,
and some browsers may block it. for example, eBay block scripts in
their listing builder. We still can set the size of a window without
using JavaScript. I had the sample of a such code, but can no find it,
have lost somewhere.


这篇关于没有javascript的图像预览器代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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