Limit image Width
<script language=”JavaScript” type=”text/javascript” >
<!–
function getWidth() {
setwidth=200;
x=document.getElementById(’Image1′).offsetWidth;
y=document.getElementById(’Image1′).offsetHeight;
if(x>setwidth) {
xn=setwidth;
y=y*xn/x;
document.getElementById(’Image1′).style.width=xn+”px”;
document.getElementById(’Image1′).style.height=y+”px”;
}
}
onload=getWidth;
//–>
</script>
全站熱搜
留言列表