In this repo i store all my websites, each in a different branch
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

52 行
1.2 KiB

/*jslint unparam: true, browser: true, indent: 2 */
;(function ($, window, document, undefined) {
'use strict';
Foundation.libs.alerts = {
name : 'alerts',
version : '4.2.2',
settings : {
speed: 300, // fade out speed
callback: function (){}
},
init : function (scope, method, options) {
this.scope = scope || this.scope;
if (typeof method === 'object') {
$.extend(true, this.settings, method);
}
if (typeof method !== 'string') {
if (!this.settings.init) { this.events(); }
return this.settings.init;
} else {
return this[method].call(this, options);
}
},
events : function () {
var self = this;
$(this.scope).on('click.fndtn.alerts', '[data-alert] a.close', function (e) {
e.preventDefault();
$(this).closest("[data-alert]").fadeOut(self.speed, function () {
$(this).remove();
self.settings.callback();
});
});
this.settings.init = true;
},
off : function () {
$(this.scope).off('.fndtn.alerts');
},
reflow : function () {}
};
}(Foundation.zj, this, this.document));