Suggests for icon display

Posted on 2006-03-31
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
    LVL 70

    Expert Comment

    by:Jason C. Levine
    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 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

    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.

    LVL 7

    Author Comment


         "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

    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

    Thanks for the points and the grade.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now