js实现警告框消息框和确认框特效 -JS/jQuery代码 -演示与下载 -时代Java
Alert
x0p('Message', 'Hello world!');

The most simple one.

弹出对话框
Confirm
x0p('Confirmation', 'Are you sure?', 'warning');

A confirmation popup with a default icon.

弹出对话框
Prompt

An input popup with a callback function.    弹出对话框

x0p('Enter Your Name', null, 'input',
function(button, text) {
	if(button == 'info') {
		x0p('Congratulations', 
			'Your name is ' + text + '!', 
			'ok', false);
	}
	if(button == 'cancel') {
		x0p('Canceled', 
			'You canceled input.',
			'error', false);
	}
});
Want more? Here we go!
Custom Popup

Another way to call x0popup.    弹出对话框

x0p({
title: 'Custom Popup',
text: 'What is your choice?',
animationType: 'slideUp',
icon: 'custom',
iconURL: 'image/thinking.svg',
buttons: [
	{
		type: 'error',
		text: 'First'
	},
	{
		type: 'info',
		text: 'Second'
	}
]
}, function(button) {
x0p({
	title: 'Your choice', 
	text: 'You clicked ' + button + ' button!',
	overlayAnimation: false
});
});
Auto Close

Auto close the popup after some time.    弹出对话框

x0p({
title: 'Auto Close',
text: 'This popup will auto close in 3 seconds.',
animationType: 'slideDown',
icon: 'info',
buttons: [],
autoClose: 3000
});
Async Operation

Show a loading animation while executing.    弹出对话框

x0p({
title: 'Async Operation',
text: 'Try to do some operation.',
icon: 'info',
animationType: 'fadeIn',
buttons: [
	{
		type: 'cancel'
	},
	{
		type: 'info',
		text: 'Do It!',
		showLoading: true
	}
]
}, function(button) {
if(button == 'info') {
	// Simulate Delay
	setTimeout(function() {
		x0p('Done', null, 'ok', false);
	}, 1500);
}
});
Advanced Input

Placeholder, validator, etc.    弹出对话框

x0p({
title: 'Number Check',
type: 'warning',
inputType: 'text',
inputPlaceholder: 'Number Only',
inputColor: '#F29F3F',
inputValidator: function(button, value) {
	if(value == '' || isNaN(value))
		return 'Not a number!';
	return null;
}
}, function(button, text) {
if(button == 'warning') {
	x0p('Congratulations', 
		'Your number is ' + text + '!', 
		'ok', false);
}
});
下载代码说明
X关闭

js实现警告框消息框和确认框并带有确认及退出按钮特效源码

js实现警告框消息框和确认框并带有确认及退出按钮特效源码是一段实现了带有确认按钮、退出按钮等特效的警告框消息框和确认框的代码,是一款基于x0popup.js实现的用于替代原生警告框,消息框和确认框的纯js插件本段代码适应于所有网页使用,本段代码兼容目前最新的各类主流浏览器,是一款非常优秀的特效源码,有需要的朋友们就来下载使用吧。如果大家非常好奇该段代码所带来的动画效果的话,可以点击【演示地址】进