How to use the zepto.os function in zepto

To help you get started, we’ve selected a few zepto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mipengine / mip / extensions / mip-share / 0.2 / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
github mipengine / mip-extensions / mip-share / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
        };
    }
github mipengine / mip-extensions / mip-share / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
        };
github mipengine / mip-extensions / mip-share / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
github QzoneTouch / commonWidget / photocompress / src / compress.js View on Github external
mpImg.onrender = function () {
				var base64Str = "";
				if ($.os.android && param.type == "image/jpeg") {
					// using jpegEncoder to fix android machine does not support jpeg
					var ctx = canvas.getContext('2d');
					var imgData = ctx.getImageData(0, 0, canvas.width, canvas.height);
					var encoder = new JPEGEncoder(param.quality * 100);
					base64Str = encoder.encode(imgData);
					encoder = null
				} else {
					base64Str = canvas.toDataURL(picParam.type, picParam.quality);
				}
				callback(base64Str);
			};
github mipengine / mip / extensions / mip-share / 0.2 / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
        };
github mipengine / mip / extensions / mip-share / 0.2 / share / detect.js View on Github external
function getOS () {
        if (!UA) {
            return;
        }

        var OS,
            version = '';

        // 优先使用zepto方法,否则通过ua匹配
        if ($ && $.os) {
            if ($.os.ios) {
                OS = 'ios';
            } else if ($.os.android) {
                OS = 'android';
            }
        } else {
            if ((UA.indexOf('iphone') > -1 || UA.indexOf('ipod') > -1)) {
                OS = 'ios';
            } else {
                OS = 'android';
            }
        }

        return {
            n: OS,
            v: version
        };
    }

zepto

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis