Posted By

xalexx on 01/26/08


Tagged

width ie layout


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite

SpinZ
snucko
micmath
shapeshifta
guo3823538


Min-width & max-width for IE


 / Published in: JavaScript
 

  1. window.attachEvent('onload', mkwidth);
  2. window.attachEvent('onresize', mkwidth);
  3.  
  4. var minwidth = document.getElementById("site").currentStyle['min-width'].replace('px', '');
  5. var maxwidth = document.getElementById("site").currentStyle['max-width'].replace('px', '');
  6.  
  7. function mkwidth(){
  8. document.getElementById("site").style.width = document.documentElement.clientWidth < minwidth ? minwidth+"px" : (document.documentElement.clientWidth > maxwidth ? maxwidth+"px" : "100%");
  9. };

Report this snippet  

You need to login to post a comment.