[Javascript] Use javascript to stop linked CSS getting fetched from cache?

Barney Carroll barney at textmatters.com
Mon Jun 18 09:40:59 CDT 2007


Roland, Troy, Mike, Hassan, John...

Thanks for the overwhelming response. There are some incredible tricks 
there, sadly none of them do the job!

I have, however, re-arranged my actual styles a bit and discovered 
something useful. If I apply overflow:hidden to every parent element up 
the chain, there is no chance of the element's padding breaking out - 
however now the clipping is way too agressive and potentially cuts off 
crucial content. In this case, though, the rendering can be 'healed' if 
an anchor within the troublesome element gets focus.

So I decided to do this:

   if(self.innerHeight){
     function fixPartialFOUC(){
       link = document.getElementByTagName("a");
       link[1].focus();
       link[1].blur(); // if the focus is already there, nothing happens
     }
   window.onload = fixPartialFOUC;
   window.onresize = fixPartialFOUC;
   }


So, if ever anybody has weird layered overflow:hidden problems... 
There's a one in a million chance this is your medicine.


Regards,
Barney



More information about the Javascript mailing list