<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Map page Special effects code </title>
<style>
<!--, in many cases, the use of this method will increase the IE load. -->
. thumbimage {
max-width:50px;
max-height:50px;
}
* HTML. Thumbimage {
Width:expression (This.width > && this.width > This.height 50:true);
Height:expresion (This.height > 50:true);
}
</style>
<body>
</body>
Yahoo picture's scaled down code::
<script type= "text/web Effects" >
function Setimgsize (img,width,height) {
var maxwidth=width;//set Picture width limit
var maxheight=height;//set Picture height limit
var heightwidth=img.offsetheight/img.offsetwidth;//set aspect ratio
var widthheight=img.offsetwidth/img.offsetheight;//set ratio of width to height
if (img.offsetwidth>maxwidth) {
Img.width=maxwidth;
Img.height=maxwidth*heightwidth;
}
if (img.offsetheight>maxheight) {
Img.height=maxheight;
Img.width=maxheight*widthheight;
}
}
</script>
Use:
<script language= "Web Effects" >
<!--
var flag=false;
Function DrawImage (IMGD) {
var image=new image ();
Image.src=imgd.src;
if (image.width>0 && image.height>0) {
Flag=true;
if (image.width/image.height>= 180/110) {
if (image.width>180) {
imgd.width=180;
imgd.height= (image.height*110)/image.width;
}else{
imgd.width=image.width;
imgd.height=image.height;
}
/*imgd.alt= "bigpic" */
}
else{
if (image.height>110) {
imgd.height=110 ;
imgd.width= (image.width*110)/image.height;
}else{
imgd.width=image.width;
imgd.height=image.height;
}
/*imgd.alt= "Bigpic"/
}
}
}
//-->
</script>
Method Four (CSS mandatory) JS code
<script type= "Text/javascript" >
function Resizeimage (obj) {
Obj.width = obj.width > && obj.width > Obj.height? 50:auto;
Obj.height = obj.height > 50? 50:auto;
}
</script>