JS scaling the specified HTML Element

Source: Internet
Author: User
/** Zoomit, it actually scales the internal element of El * @ Param {htmlelemnt} EL to zoom in to the target htmlelement * @ Param {number} XScale X to zoom in ratio * @ Param {number} yscale y ratio */zoomit: function (El, XScale, yscale) {var S = kissy, style = $ (EL ). ATTR ('style') | ""; if (S. UA ['Firefox ']) {// ratio of X axis direction and Y direction ('transform', 'scale (' + XScale + ',' + yscale + ')'); // after scaling, the offset relative to the upper left corner of the parent element (el).css ('transform-origin', '0px 0px ');} else if (S. UA ['ie ']> = 9) Elastic Compute (elastic.css ('-MS-transform ', 'scale (' + XScale + 'region') Elastic Compute (el).css ('-MS-transform-origin ', '0px 0px ');} else if (S. UA ['ie'] <9) Elastic Compute (el).css ('zoom ', XScale);} else Elastic Compute (el).css ('-WebKit-transform ', 'scale (' + XScale + ', '+ yscale + '{'{}(el}.css ('-WebKit-transform-origin', '0px 0px ');}}

In the browser's opinion, kissy is used here; In attribute operations, JQ is used here. Readers can make corresponding modifications according to their habits.

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.