js代码(function ($) { function dialogue(content, title, width, height, call) {
$("<div/>").qtip({
content: {
text: content,
title: title
},
position: {
my: 'center',
at: 'center',
target: $(window)
},
show: {
ready: true,
modal: {
on: true,
blur: false
}
},
hide: false,
style: {
classes: 'qtip-blue',
width: width,
height: height
},
events: {
render: function (event, api) {
$('button', api.elements.content).click(function (e) {
api.hide(e);
});
},
hide: function () { (call && call()); }
}
});
}
$.alert = function (title, content, width, height, call) {
var message = $('<p />', { text: content }),
ok = $('<button />', { text: '确定', 'class': 'full' }); dialogue(message.add(ok), title, width, height,call);
};})(jQuery);
html调用
$.alert("提示", "用户名不能为空!", 120, 80, function () { $("#xqname").focus(); });
$("<div/>").qtip({
content: {
text: content,
title: title
},
position: {
my: 'center',
at: 'center',
target: $(window)
},
show: {
ready: true,
modal: {
on: true,
blur: false
}
},
hide: false,
style: {
classes: 'qtip-blue',
width: width,
height: height
},
events: {
render: function (event, api) {
$('button', api.elements.content).click(function (e) {
api.hide(e);
});
},
hide: function () { (call && call()); }
}
});
}
$.alert = function (title, content, width, height, call) {
var message = $('<p />', { text: content }),
ok = $('<button />', { text: '确定', 'class': 'full' }); dialogue(message.add(ok), title, width, height,call);
};})(jQuery);
html调用
$.alert("提示", "用户名不能为空!", 120, 80, function () { $("#xqname").focus(); });
解决方案 »
- JS中跨域获取json数组数据,搞不定啦!!!新人求帮助啊亲们!
- 有没有什么浏览器的插件,可以定位函数的源代码?
- 这段JS脚本什么意思?
- 正则想后因用。
- 请问关于MouseDown的问题
- 高分求:急问哪有js的比较深入的,可以做参考手册的教程下载?
- 如何只对页面图片禁止右键?在线等待!
- html前台select控件的用法.....
- 一段小代码运行时报错Uncaught TypeError: Cannot read property 'style' of null 。恳请大神解答
- js
- $.post返回页面带有<script>标签的div元素解析,拿不到<script>标签
- setInterval()有Bug?
render: function (event, api) {
$('button', api.elements.content).click(function (e) {
api.hide(e);
}).focus();
},如果是弹出框里的按钮聚焦的话应该是这样。
onShow: function (event) {
$('button', this.elements.content).click(function (e) {
api.hide(e);
}).focus();
},
onHide: function () { return; (call && call()); }
}