Javascript & CSS attributes (Visibility vs Display)

I’m messing around trying to create a “Daily del.icio.us links” box which is dynamically populated via AJAX & a PHP + Magpie RSS script…

I’m using prototype.js as I’ve mentioned previously as a generic AJAX helper library. I was stumped when Element.show stopped working.. then I realised that it just changes the display: attribute to be null and I was using visibility: hidden..

Apparently the difference between the two is that if an element has display: none set - no space is reserved for it at all, whereas it actually exists and owns space with visibility: hidden..

Also I have learned via google searching that setting display: ” on a div still won’t show it, so I guess I’m going to be patching prototype.js again

Leave a Reply