简体   繁体   English

图像调整大小脚本

[英]Image resize script

I'm searching a javascript that can resize images similar to script thats available as a plugin in vBulletin CMS:我正在搜索一个 javascript,它可以调整图像的大小,类似于 vBulletin CMS 中的插件可用的脚本:

在此处输入图像描述

I want the script to be used in blogger blog so that all images i upload into a post are resized to a smaller res and on clicking the image should be displayed in original dimensions我希望在博主博客中使用该脚本,以便我上传到帖子中的所有图像都调整为较小的分辨率,并且单击图像时应以原始尺寸显示

Something of the sort getelementbyID("img") . getelementbyID("img")之类的东西。

are there any script providing this feature?有没有提供此功能的脚本? Pls help me out请帮帮我

Thanks in advance.提前致谢。

Something like a lightbox , perhaps?可能是灯箱之类的东西?

I know the specific interaction you're asking about, and personally, I've always found it really obnoxious.我知道你要问的具体互动,而且就个人而言,我一直觉得它真的很讨厌。

If you don't want to use a server side script to automatically create a smaller version of the image that you would link to the larger version, I wouldn't recommend using JavaScript to resize an image either.如果您不想使用服务器端脚本自动创建要链接到较大版本的图像的较小版本,我也不建议使用 JavaScript 来调整图像大小。 I'd recommend setting the image's dimensions in CSS and then attaching a click handler with JS that showed the image in some sort of overlay (or just using HTML to link to the larger image file).我建议在 CSS 中设置图像的尺寸,然后附加一个带有 JS 的单击处理程序,以某种叠加方式显示图像(或仅使用 HTML 链接到更大的图像文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM