How to use the zepto.fn 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-platform / mip-cy-script / mip-cy-script.js View on Github external
}

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft swiperight', function (event, data) {
                    if (data.type === 'swiperight') {
                        callback();
                    }

                });
            });
        };
    }

    if (typeof ($.fn.swipeUp) !== 'function') {
        $.fn.swipeUp = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeup', callback);
            });
        };
    }

    if (typeof ($.fn.swipeDown) !== 'function') {
        $.fn.swipeDown = function (callback) {
            if (this.length === 0) {
                return;
            }
github mipengine / mip-extensions-platform / mip-cy-script / mip-cy-script.js View on Github external
if (typeof ($.fn.swipeDown) !== 'function') {
        $.fn.swipeDown = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipedown', callback);
            });
        };
    }

    if (typeof ($.fn.tap) !== 'function') {
        $.fn.tap = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('tap', callback);
            });
        };
    }

    $('.btn-back').on('click', function () {
        window.history.back();
    });

    return customElem;
github mipengine / mip-extensions-platform / mip-cxx / mip-cxx.js View on Github external
define(function (require) {
    var $ = require('zepto');
    $('.middle,.bottom').hide();
    $('.comment .text').click(function () {
        $('.middle,.bottom').show();
    });
    $('.cancel').click(function () {
        $('.middle,.bottom').hide();
    });
    $.fn.nextAll = function (selector) {
        var nextEls = [];
        var el = this[0];
        if (!el) {
            return $([]);
        };
        while (el.nextElementSibling) {
            var next = el.nextElementSibling;
            if (selector) {
                if ($(next).is(selector)) {
                    nextEls.push(next);
                }
            } else {
                nextEls.push(next);
            }
            el = next;
        }
github mipengine / mip-extensions / src / mip-dp-script / mip-dp-script.js View on Github external
if (typeof ($.fn.swipeDown) !== 'function') {
        $.fn.swipeDown = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipedown', callback);
            });
        };
    }

    if (typeof ($.fn.tap) !== 'function') {
        $.fn.tap = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('tap', callback);
            });
        };
    }

    $('.btn-back').on('click', function () {
        window.history.back();
    });

    return customElem;
github mipengine / mip-extensions / src / mip-dp-script / mip-dp-script.js View on Github external
}

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft swiperight', function (event, data) {
                    if (data.type === 'swiperight') {
                        callback();
                    }

                });
            });
        };
    }

    if (typeof ($.fn.swipeUp) !== 'function') {
        $.fn.swipeUp = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeup', callback);
            });
        };
    }

    if (typeof ($.fn.swipeDown) !== 'function') {
        $.fn.swipeDown = function (callback) {
            if (this.length === 0) {
                return;
            }
github mipengine / mip-extensions-platform / mip-cy-script / mip-cy-script.js View on Github external
scriptstr += '$("#' + tag + '").append($("#' + tag + '_temp").children().not("script"));';
                    scriptstr += '<\/script>';
                }

                $(obj).addClass('loaded');
            });
        }

        if (scriptstr) {
            document.write(scriptstr);
        }

    };

    if (typeof ($.fn.swipeLeft) !== 'function') {
        $.fn.swipeLeft = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft', callback);
            });
        };
    }

    if (typeof ($.fn.swipeRight) !== 'function') {
        $.fn.swipeRight = function (callback) {
            if (this.length === 0) {
                return;
            }
github mipengine / mip-extensions / src / mip-dp-script / mip-dp-script.js View on Github external
if (typeof ($.fn.swipeLeft) !== 'function') {
        $.fn.swipeLeft = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft', callback);
            });
        };
    }

    if (typeof ($.fn.swipeRight) !== 'function') {
        $.fn.swipeRight = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft swiperight', function (event, data) {
                    if (data.type === 'swiperight') {
                        callback();
                    }

                });
            });
        };
    }
github mipengine / mip-extensions-platform / mip-cy-script / mip-cy-script.js View on Github external
if (typeof ($.fn.swipeLeft) !== 'function') {
        $.fn.swipeLeft = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft', callback);
            });
        };
    }

    if (typeof ($.fn.swipeRight) !== 'function') {
        $.fn.swipeRight = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft swiperight', function (event, data) {
                    if (data.type === 'swiperight') {
                        callback();
                    }

                });
            });
        };
    }
github mipengine / mip-extensions-platform / mip-cy-script / mip-cy-script.js View on Github external
};

    if (typeof ($.fn.swipeLeft) !== 'function') {
        $.fn.swipeLeft = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft', callback);
            });
        };
    }

    if (typeof ($.fn.swipeRight) !== 'function') {
        $.fn.swipeRight = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeleft swiperight', function (event, data) {
                    if (data.type === 'swiperight') {
                        callback();
                    }

                });
            });
        };
    }
github mipengine / mip-extensions / src / mip-dp-script / mip-dp-script.js View on Github external
}

    if (typeof ($.fn.swipeUp) !== 'function') {
        $.fn.swipeUp = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipeup', callback);
            });
        };
    }

    if (typeof ($.fn.swipeDown) !== 'function') {
        $.fn.swipeDown = function (callback) {
            if (this.length === 0) {
                return;
            }

            $.each(this, function (i, elm) {
                var gesture = new Gesture(elm);
                gesture.on('swipedown', callback);
            });
        };
    }

    if (typeof ($.fn.tap) !== 'function') {
        $.fn.tap = function (callback) {
            if (this.length === 0) {
                return;

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