// tags init
if(typeof $.fn.tagsInput !== 'undefined'){
$('#role').tagsInput();
}
引入,数组对象里面要有name
$('#role').importTags(checkNode);
自己写的input框和tag自动生成的框会冲突,隐藏掉自己的框
顺便给生成的框设置一下样式,生成的框命名 ‘XXX_tagsinput‘
.tagHide{
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
}
toastr.options = {
"closeButton": false,
"debug": false,
"newestOnTop": false,
"progressBar": false,
"positionClass": "toast-top-center", //弹出的位置
"preventDuplicates": true,//相同提示内容只显示一个
"onclick": null, //点击消息框自定义事件
"showDuration": "300", //显示动作时间
"hideDuration": "1000", //隐藏动作时间
"timeOut": "2000", //自动关闭超时时间
"extendedTimeOut": "1000", //控制时间
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn", //显示的方式,和jquery相同
"hideMethod": "fadeOut" //隐藏的方式,和jquery相同
};
其余地方要用的时候,定义一下
var toastr = parent.toastr;// 上一级定义的
var toastr = window.top.toastr;//页面最顶层的
改变弹窗的位置,自带的没有居中选项,直接更改toastr的位置
#toast-container{
margin-top: 20% !important;
}
原文:https://www.cnblogs.com/xixicf/p/12162605.html