JS implementation of the picture, etc. than the thumbnail display support ie/ff_ image effects

Source: Internet
Author: User
<script language= "JavaScript" > var flag=false; function MyImage (Img) {var image=new image (); IMAGE.SRC=IMG.SRC; width=236;//the desired wide value of the preset height=170;//the desired high value if (image.width>width| | Image.height>height) {//The existing picture has only a wide or superb preset value for JS control w=image.width/width; H=image.height/height; if (w>h) {//ratio is larger ==> width than tall//set width to the width of img.width=width; The following is computed height img.height=image.height/w; }else{//height ratio wide//set width is high img.height=height; The following is computed height img.width=image.width/h; }} </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.