Min and max width in IE6


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <!--[if lte IE 6]>
  2. <script type="text/javascript">
  3. window.attachEvent('onload', mmwidth);
  4. window.attachEvent('onresize', mmwidth);
  5. function mmwidth(){
  6. document.getElementById('somediv').style.width = ((document.documentElement.clientWidth ||
  7. document.body.clientWidth) < 1000) ? '1000px' :
  8. ((document.body.clientWidth > 1000) ? 'auto' : 'auto');
  9. };
  10. </script>
  11. <![endif]-->

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.