English 中文(简体)
储存图像的最有效方式是什么? 传真/CSS/JS
原标题:What is the most efficient way to store an image? HTML/CSS/JS

我将掌握许多图像,并设法找到最有效率的方式储存这些图像,以保持页数。

到目前为止,我只想到两种方式:装载javascript eg picture = 新的形象;图片.src = “file.jpg”; and append /mov to the page as necessary, orload into <img> and set :none

是否有其他选择? 什么是这样做的最佳途径?

最佳回答

拍照的最佳方式(如果你正在建造的照片)通常是有几幅图像,至少是两幅:

  1. a smallish size that is highly compressed and thus have a small footprint: this is the image you load into grids and display in a page where there are multiple images
  2. a larger image with lower compression and higher image quality - this is the one you show when people want to see details.

Since people most often come to the detailed image from a page where the small/fast loading version has already been shown, and thus is already in the browsers cache, you do a little trick and have instant photos, without preloading anything.

就像这一点一样:

在详细页上,你显示,在具有较大详细版本内容的图像标签中,低形象被压缩。 然后,通过<条码>新图像/代码>,在背景中填上更详细的内容,附有<条码><>onload>/code>。

它看着伟大的景象,工作快,用户将爱你。

PS:储存图像的最佳途径是浏览器、而不是剪辑或投影器,这样,如果你真的希望把图像上上载,这通常是一种不良的做法(有时可能是必要的),就会使浏览器在这种背景中为你们打上手套,把他们用在你网站上的直观带上。

问题回答

我不敢肯定“效率”,但最符合逻辑的方式是不使用 Java语装上形象(如果 you有残疾的话),或者通过显示财产(如智者,浏览器可能只是装上图像)。

因此,一个明智的建议是利用旧的aging和显示每页的 n形象。 然而,为了达到这一目的,您可以使用“lazy”(a.k.a.“被推荐”)的装载和通过Ajax增加的页面内容作为用户浏览器。 然而,关键是,如果贾瓦古兰经残疾,这种卑鄙的贬低了标准的“page”行为。

这方面的完美例子有:谷歌的,以及如果你上查询。 你们看到关于可能执行问题的讨论等。

最好用java书写你掌握的方式,然后按照你的需要,将其添加到OMM,而不是首先在OMD中添加,然后躲藏起来,因为DOM的操纵速度要慢得多,你可能不使用某些图像。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签