JQuery returns a multiple of the scaled html elements.

Source: Internet
Author: User
[Javascript]/** get the magnification of el scaling */getZoomLeve: function (el) {// mark the css attribute varzoomPer, undefinedPer & amp; #39; none & amp; #39 ;;... syntaxHighlighter. all (); [javascript]/** get the multiple of el's scaling */getZoomLeve: function (el) {// mark the scaled css attribute var zoomPer, undefinedPer = 'none'; if (S. UA ['Firefox ']) {zoomPer ='-moz-transform ';} else if (S. UA ['ie ']) {if (S. UA ['ie '] = 9) {zoomPer ='-ms-transform';} else {zoomPer = 'zoom '; un DefinedPer = 'normal';} else {zoomPer = '-webkit-transform';} var ret = 1; // calculate the scaled size of the element in Iframe first while (el. ownerDocument! = Document) {ret * = getZoom (el); var $ ifrs = $ ('iframe'), curWin = el. ownerWindow, ifr; S. each ($ ifrs, function (item) {try {if (item. contentWindow = curWin) {ifr = item; return false ;}} catch (e) {// capture cross-origin access errors}); if (ifr) {el = ifr;} else {break;} ret * = getZoom (el); function getZoom (htmlEl) {var ret = 1; // here, add calculates the zoom of el into S. each ($ (htmlEl ). parents (). add ($ (htmlEl), function (el) {if ($ (Elast.css (zoomPer) & templates (elast.css (zoomPer )! = UndefinedPer) {if (S. UA ['ie '] & S. UA ['ie '] <9) {ret * = el. style. zoom;} else {var temp = (el).css (zoomPer), start = temp. indexOf (') + 1, end = temp. indexOf (','); ret * = temp. substring (start, end) ;}}); return ret ;}return ret ;}
Related Article

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.