Another picture automatically shrink the JS code _ image Effects
Source: Internet
Author: User
<script language= "JavaScript" >
<!--
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>
Where the pictures are used:
Width= "180" height= "110" Note that here is the best qualification, if you do not limit the load map will become the original large, and then shrink, this process if the picture is very difficult to see. Here is the width and height, in the front of JS change, here also make the corresponding change.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service