Published in: JavaScript
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%"); };
You need to login to post a comment.
