(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as anonymous module.
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node / CommonJS
factory(require('jquery'));
} else {
// Browser globals.
factory(jQuery);
}
})(function ($) {
'use strict';
var types = ['notice', 'warning', 'error', 'success'];
var audio;
var settings = {
inEffect: {
opacity: 'show'
},
inEffectDuration: 100,
stay: 5000,
sticky: false,
type: 'notice',
position: 'top-right',
sound: null
};
var notify = {
show:function(){
$('audio').remove();
var audioElementHovertree = $('<audio></audio>');
$("body").append(audioElementHovertree);
audioElementHovertree.attr('src', '/assets/img/classic.mp3');
audioElementHovertree.attr('autoplay', 'autoplay'); //打开自动播放
//audioElement.load();
}
};
return notify;
});
没有jquery.notify那么专业,不过可以用。