views:

22

answers:

2

I'm on a quest to reduce my very bloated home page application in development. I've optimized the CSS and JS requests using a server size combine/stitcher and minimizer.

I'm now at the point where I have an image carousel rotating 15 images as a magazine style layout. In addition there are non-carousel spots with a total of 8 objects. I'd like to group the small images into as few as three large images to reduce the object requests.

Assumptions:
These images are purely decorative with the article.
Although the above is true, they still should have alt text available in the case the images are not available since they do convey an idea (accessibility req).
Each image is about the same size 130Wx80H
Each image is a stock photograph of something
There are two domains available for parallel downloading
There are two more groups of small images with 4 images each.

Goals: Initially, I thought I would just use background images and have the server-side create and cache a sprite image and CSS generator. However, I'm not sure about accessibility. Then, I considered that by default background images are not printed. That would result in a lot of white.

Question: Can I group images while still remaining accessible and keeping a proper flow for screen readers. Is my only recourse to use the plain old img tag and try to split the objects' URIs between the two domains? And yes, the very obvious thing is to redesign and remove the images altogether, but this is an ecommerce/magazine website.

+1  A: 

I would suggest looking up how "sprites" work, that is what you are talking about with "groups". Sprites will work well with all of your decorative images, and decrease load time. It shouldn't effect accessibility as long as you stick to the rules of normal images & things, like alt tags.

Hope this helps.

Nicknameless
Are you suggesting that I use transparent gifs with alt tags and set the background image of the image to be my sprites? And, indeed, I was referring to using sprites. I already use them for decorative items like 15x15 px things. The problem is that you can use alt tags with background images.
Jason Tabler
I found this after adding the word "accessibility" to my search.http://www.artzstudio.com/2010/04/img-sprites-high-contrast/
Jason Tabler
That's an excellent article, and looks like it will work. I think you just answered your own question :D
Nicknameless
Yes, it seems to be working. I've got an acceptable solution for images off and CSS off. This is a great solution if you don't need any CSS pseudo classes with background-images! Now I've got to build something that automatically builds the master image and adds the appropriate CSS. At least that I can handle!
Jason Tabler
A: 

The solution here works great. The Caveat is that you also need to add the image dimensions width/height in the img tag so that it's fine with CSS turned off. http://www.artzstudio.com/2010/04/img-sprites-high-contrast/

Jason Tabler
This technique is awesome. I completed a spriteBuilder CFC that takes any number of images of any dimension and lays them out on a grid. It stores the CSS properties in an array which can be looped through to output img and container tags with the appropriate inline CSS as outlined in the blog linked above. I reduced the number of objects on the page dramatically.
Jason Tabler