Jump to content

image sprites


jimfog

Recommended Posts

I intend using image sprites, but the thing I do not know if it is recommended for image depiction scenarios. Let me explain: I want two images(the images of arrows) to appear simultaneously in the page.Is a sprite to way to in such a case? I think yes, I am not sure though. Somehow I think that css sprites is best for hover elements-when we need the part of the image sprite one at a time.

Link to comment
Share on other sites

Sprites are used to show usually 2 different stages, the default/normal and the hover as one single image, and usullay as a background image, the advantages are, if you use two images, on the first instance of hover a slight delay is seen, as the hover stage image loads, whereas with sprite image the two stages are loaded in one go. As background position is used to show different image stages at a giving stage, it is possible to load different stages of all images used on your website in one large sprite. Then all these images will be preloaded and ready to use.

Link to comment
Share on other sites

So it is not so appropriate for my case as I understand. tell me if I understood correctly.

Link to comment
Share on other sites

think of sprites as preloading all your images through one really large image (i.e. one large image composed of all your sites images), and just using background-position to show the right part of the large image, that focuses on just the image you want. it is applicable in any situation where you want to use images, since its a general optimization technique, requiring less HTTP requests for the same amount of resources. (and thus no "blinks"/flickers) like in the situation dsonesuk described.

Link to comment
Share on other sites

It's fine to use sprites even if the images are static, sprites save the overhead involved in HTML requests because you have to make fewer requests to get the images if they are combined in the same file. I use sprites that have 20 or so different images in them for various buttons and states, like this one: tool-sprites.gif

Link to comment
Share on other sites

It's fine to use sprites even if the images are static, sprites save the overhead involved in HTML requests because you have to make fewer requests to get the images if they are combined in the same file. I use sprites that have 20 or so different images in them for various buttons and states, like this one: tool-sprites.gif
Seing this image now, I am going to be more specific about where I want to use the arrows-it is for a calendar, as such the arrows need to be there all the time-when changing the days for example. The above example lies behind my question. What do you think?
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...