One obvious mistake is:
Code:
<script type=""text/javascript>
window.onload = resizeImg(document.body.clientHeight - 100, document.body.clientWidth - 100);
window.onresize = resizeImg(document.body.clientHeight - 100, document.body.clientWidth - 100);
function resizeImg(width, height) {
document.getElementById("img").style.height = height;
document.getElementById("img").style.width = width;
}
</script>
...Also, when do you want it to resize to it's original size BTW?
...Maybe you want a button..or what...If you're on the decision already, just use the image's id:
Code:
document.getElementById("img").style.height = '300px';
document.getElementById("img").style.width = '300px'
Hope that helps

Bookmarks