[Last Call] Learn how to a build a cloud-first strategyRegister Now


Suggests for icon display

Posted on 2006-03-31
Medium Priority
Last Modified: 2010-08-05

This is kind of a general question, I'm not sure how to start this. I'd like to provide the user with a list of icons they can choose to associate with some data.

So.. I'll probably have like 80 icons all together, each of which are 16x16 pixels, that's about 1kb each. That would be in total lets say safely 100kb - should I somehow make them download all the icons as soon as they visit my page - or is there some slick way to only transmit the icons they are trying to view?

Another point on that - what would be a good way to display so many icons? I was thinking a popup menu that had categories, and sub categories like:

    Icons -> Sports   -> baseball
                             -> hockey
                 Parties  -> birthday
                             -> office
                             -> holiday
                 Holidays -> xmas
                              -> halloween
                 Animals  -> etc

you get the idea. So if I do something like that, will I have to make sure all the icons are transmitted to the user at page load? Will a copy of the icons remain on their disk somehow so I won't have to keep sending them the whole icon batch everytime they visit?

Question by:minnirok
  • 3
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16345141
Hi minnirok,

It sounds like you will need some sort of way to save the user preferences, so you are looking at cookies, sessions, and a scripting language connecting to  MySQL.  

Depending on how complex you want to make this, you could load all of this into a small SQL table and display icons as the user browsers by doing queries...at 16k each, I wouldn't worry too much about bandwidth but if there is a way to limit how many display at a time, your users will appreciate it.

LVL 28

Expert Comment

ID: 16355244
With the script here you preloading all the images into the browser's cache, if the cache hasn't been cleared (most people don't clear the cache on their browser unless they are having problems) the browser would probably reuse the same image without reloading them.



Author Comment

ID: 16361324

     "the browser would probably reuse the same image without reloading them."

How could I check if the browser is actually using the images from the cache instead of always asking from the server everytime the page is visited?
If it were really the case that it just uses the image from the cache, that would be perfect.

LVL 28

Accepted Solution

gamebits earned 2000 total points
ID: 16361650
I would do a test with let say 5 images available, I would visit the page once, than I would change the images but with the same name,

i.e. pic1.gif, pic2.gif, pic3.gif etc. the first time

Then you use different pictures but with the same name.

Then you revisit the page if you still have the first set of image than the browser used the ones in the cache on refresh you should see the new set of image.

Actually I don't think you even have to use the preload script for that.

LVL 28

Expert Comment

ID: 16376950
Thanks for the points and the grade.


Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question