Return to Snippet

Revision: 4879
at January 26, 2008 05:52 by xalexx


Initial Code
window.attachEvent('onload', mkwidth);
window.attachEvent('onresize', mkwidth);

var minwidth = document.getElementById("site").currentStyle['min-width'].replace('px', '');
var maxwidth = document.getElementById("site").currentStyle['max-width'].replace('px', '');

function mkwidth(){
    document.getElementById("site").style.width = document.documentElement.clientWidth < minwidth ? minwidth+"px" : (document.documentElement.clientWidth > maxwidth ? maxwidth+"px" : "100%");
};

Initial URL

                                

Initial Description

                                

Initial Title
Min-width & max-width for IE

Initial Tags
ie, layout

Initial Language
JavaScript