CSS expression Control picture Autoscale effect code [compatible Ie,firefox]_ experience Exchange

Source: Internet
Author: User
Today it took a long time to finally solve the problem, the basic perfect, the only imperfect is IE 6 only after the full download of the picture will automatically adjust the size, but better than nothing, it is more comfortable than to see the long horizontal scroll bar after entering the page, here used expression, but the use of a load , so expression does not cause a memory leak. Of course, if you have a better solution, hope to communicate with me.

The code is as follows:

. Image {max-width:600px;height:auto;cursor:pointer; border:1px dashed #4E6973;p adding:3px; zoom:expression (function ( Elm) {if (elm.width>560) {var oldvw = elm.width; elm.width=560; elm.height = elm.height* (560/OLDVW);} Elm.style.zoo m = ' 1 '; } (this)); }
  • 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.