How to use the zepto.extend 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-vd-popup / popup.js View on Github external
var PopupFrame = function (opt) {
        var me = this;
        // 设置默认值
        me.options = $.extend({
            title: '',              // 标题,支持html和Zepto对象
            content: '',            // 内容,支持html和Zepto对象
            fullView: false,        // 是否全屏
            duration: 400,          // 动画执行时间
            customClassName: '',    // 自定义样式名
            onOpen: function () {},
            onClose: function () {}
        }, opt);
        // 初始化
        me._init();
    };
github mipengine / mip-extensions-platform / mip-qqtnhealth-dynamicmenu / mip-qqtnhealth-dynamicmenu.js View on Github external
$.fn.scrollTo = function (options) {
        var defaults = {
            toT: 0, // 滚动目标位置
            durTime: 160, // 过渡动画时间
            delay: 30, // 定时器时间
            callback: null // 回调函数
        };
        var opts = $.extend(defaults, options);
        var timer = null;
        var thisThis = this;
        var curTop = thisThis.scrollTop();
        var subTop = opts.toT - curTop;
        var index = 0;
        var dur = Math.round(opts.durTime / opts.delay);
        var smoothScroll = function (t) {
                index++;
                var per = Math.round(subTop / dur);
                if (index >= dur) {
                    thisThis.scrollTop(t);
                    window.clearInterval(timer);
                    if (opts.callback && typeof opts.callback === 'function') {
                        opts.callback();
                    }
github mipengine / mip-extensions-platform / mip-vd-popup / tab.js View on Github external
this.navs = [];
        this.seps = [];
        this.conts = [];
        this.sum = 0;       // tab切换次数
        this.last = null;   // 上次tab切换序号

        // 函数
        this.onChange = options.onChange || fn;
        this.onResetChange = options.onResetChange || fn;
        this.onTabScrollEnd = options.onTabScrollEnd;

        // init
        panel && _init.call(this, options);
    };

    $.extend(Tabs.prototype, {
        showContent : function(i){
            var cont=this.conts[i];
            if(cont){
                $(this.conts[i]).show();
            }
        },
        hideContent : function(i){
            var cont=this.conts[i];
            if(cont){
                $(cont).hide();
            }
        },
        showTab : function(i){
            var _this = this,
                navs = _this.navs,
                seps = _this.seps;
github mipengine / mip / extensions / mip-share / 0.2 / share.js View on Github external
function Share (opt, container) {

        opt = $.extend({}, defaultOpt, opt);

        var share = new PMDShare(opt);

        // render方法可以直接在页面中渲染分享ICON
        // 由于为js渲染会出现抖动,请注意执行时机
        share.render(
            container,
            {
                onRender: function() {
                    // 初始化 分享
                    // initCopyLink(container, opt);
                }
            }
        );

        this.share = share;
github mipengine / mip / src / components / video / player.js View on Github external
function VideoPlayer(opt) {
        this.params = $.extend(true, {
            // 视频容器   必填
            container: null,

            height: null,
            width: null,
            src: null,
            type: null,
            poster: null,
            autoplay: null,
            controls: null,
            loop: null,
            muted: null,

            ios: {
                playMode: false
            },
github imweb / mobile / src / fisComponents / scrollBar / scrollBar.js View on Github external
init: function(opts) {
		this.opts = $.extend({}, defaultOpts, opts);
		this.$box = this.opts.$box;

		this.$wrapper = $('<div class="scrollBar-warpper"></div>');
		this.$bar = $('<span class="bar"></span>').insertAfter(this.$box.addClass('scrollBar').wrap(this.$wrapper));

		this.refresh();
		this.bindEvents();
	},
	refresh: function() {
github imweb / mobile / src / fisComponents / share / share.js View on Github external
init: function(opts) {  //幂等函数
		if (!this.__init__) this.initDefaultOpt();
		this.opts = $.extend({flag:share.FLAG_MQQ+share.FLAG_WEIXIN}, opts);
		var i = this.FLAG_MQQ;
		while(OP[i]) {
			if (this.opts.flag &amp; i) {
				OP[i](this.opts);
			}
			i = i &lt;&lt; 1;
		}
		this.__init__ = true;
	},
	MQQShareMessage: function(o, type, cb) {
github mipengine / mip-extensions-platform / mip-ilaw66-baidu-requestSuccess / mip-ilaw66-baidu-requestSuccess.js View on Github external
init: function (option) {
                var This = this;
                This.option = {
                    main: '显示内容'
                };
                $.extend(true, this.option, option || {});
                This.dom();
                This.bindEvent();
            },
            dom: function () {
github TrueLink / TrueLink / js / modules / channels / tlke.js View on Github external
this._defineEvent("dirty");
        this._defineEvent("addr");
        this._defineEvent("packet");
        this._defineEvent("keyReady");
    }

    Tlke.authBitLength = 16;
    Tlke.offerBitLength = 128;
    Tlke.dhPrivBitLength = 160;

    var EventEmitter = require("modules/channels/EventEmitter");
    var invariant = require("tools/invariant");
    var isMultivalue = require("modules/data-types/isMultivalue");

    Tlke.prototype = new EventEmitter();
    $.extend(Tlke.prototype, {
        generate: function () {
            this.checkEventHandlers();
            invariant(this.state === Tlke.STATE_NOT_STARTED,
                "Can't generate offer being in a state %s", this.state);
            this._generateOffer();
        },
        enterOffer: function (offer) {
            this.checkEventHandlers();
            invariant(isMultivalue(offer), "offer must be multivalue");
            invariant(this.state === Tlke.STATE_NOT_STARTED,
                "Can't accept offer being in a state %s", this.state);
            invariant(offer, "Received an empty offer");
            this._acceptOffer(offer);
        },
        enterAuth: function (auth) {
            invariant(isMultivalue(auth), "offer must be multivalue");
github imweb / mobile / src / fisComponents / share / share.js View on Github external
WeiXinShareToFriend: function(opts) {
		if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
			var shareParams = this.getWeiXinParams($.extend({}, defaultOpt, opts));
			opts.beforeWeiXinShareToFriend && (shareParams = opts.beforeWeiXinShareToFriend(shareParams));
			WeixinJSBridge.invoke("sendAppMessage", shareParams, function (res) {
				opts.onShareWeiXinFriend && opts.onShareWeiXinFriend(res);
			});
		}
	},
	WeiXinShareToTimeline: function(opts) {

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