Skip to content

knadh/jqdialog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jQdialog

jqDialog is a small (3.6 KB minified) dialog plugin that provides smooth, persistent, non-intrusive alternatives for alert(), confirm() and prompt(). There is also a notify() dialog that pops up and goes away in X seconds.

Kailash Nadh, September 2011

Documentation: http://kailashnadh.name/code/jqdialog

License: GNU Public License, http://www.fsf.org/copyleft/gpl.html

Example

// notify dialog
$.jqDialog.notify("This dialog will disappear in 3 seconds", 3);

// alert dialog
$.jqDialog.alert("This is a non intrusive alert", function() {	// callback function for 'OK' button
	alert("This intrusive alert says you clicked OK");
});

// prompt
$.jqDialog.prompt("Please enter your name",	// message
	'Sam',	// default value in the input
	function(data) { alert("Your name is " + data); },		// callback function for 'OK' button
	function() { alert("This intrusive alert says you clicked Cancel"); }		// callback function for 'Cancel' button
);

// confirm dialog
$.jqDialog.confirm("Are you sure want to click either of these buttons?",
	function() { alert("This intrusive alert says you clicked YES"); },		// callback function for 'YES' button
	function() { alert("This intrusive alert says you clicked NO"); }		// callback function for 'NO' button
);

// custom content
$.jqDialog.content('No dialog controls, just custom content<br /><input type="text" name="test" />');

About

A jQuery plugin with smooth and peristent dialog boxes meant as a replacement for alert(), confirm(), and prompt()

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published