<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Web Development Blog &#187; dialog</title>
	<atom:link href="http://www.leigeber.com/tag/dialog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.leigeber.com</link>
	<description>This web development blog features fresh articles on JavaScript, AJAX, CSS, XHTML, PHP, Photoshop and more.</description>
	<lastBuildDate>Sat, 13 Feb 2010 02:05:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Custom JavaScript Dialog Boxes</title>
		<link>http://www.leigeber.com/2008/04/custom-javascript-dialog-boxes/</link>
		<comments>http://www.leigeber.com/2008/04/custom-javascript-dialog-boxes/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 02:20:33 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[popup]]></category>

		<guid isPermaLink="false">http://www.leigeber.com/?p=23</guid>
		<description><![CDATA[This lightweight JavaScript dialog box library can easily be incorporated in your website to display alerts, prompts, warnings and success messages.]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.leigeber.com/wp-content/uploads/2008/04/error_dialog_screen.gif" alt="JavaScript dialog boxes" width="459" height="263" /></p>
<p>I have put together a lightweight (~4.5kb) JavaScript dialog box library. The script currently offers four dialog styles: alerts, warnings, prompts and success. There is nothing to add to your page except references to the JavaScript and CSS if you choose not to incorporate them in your existing files. The Divs are dynamically added to the DOM when the function is called. The function currently relies on a content wrapper to calculate the page height however you could use the body height but the background overlay would only cover the currently visible content. The variable for the wrapper ID as well as the speed and timer settings are available at the top of the JavaScript file. Dialog boxes are generated as follows.</p>
<pre class="brush: jscript;">showDialog('Error','You have encountered an error.','error',2);</pre>
<p>The first property is the title of the box, the second is the message, the third is the box style (alert, warning, prompt or success) and the fourth is an optional autohide timeout. Set the auto hide to the number of seconds you want to show the dialog before it fades out.  The message can take HTML, just be sure and escape when necessary. The &#8220;look and feel&#8221; can easily be changed through the CSS and additional styles can easily be added by adding 2 lines of CSS.</p>
<p>This script has been tested in all major browsers and is available free of charge for both personal or commercial projects under the <a href="http://creativecommons.org/licenses/by/3.0/us/" target="_blank">creative commons license</a>. Community support is <a href="http://forum.leigeber.com/">available here</a>. Paid support is also available, <a href="http://www.leigeber.com/contact/">contact me</a> for details.</p>
<p><strong>Update 4/23/2008</strong> &#8211; Added autohide feature, thanks for the suggestion Chris.<br />
<strong>Update 4/23/2008</strong> &#8211; Added dynamic vertical positioning, 1/3 way down the current viewable window.<br />
<strong>Update 4/25/2008</strong> &#8211; Resolved double click issue when closing.<br />
<strong>Update 5/21/2008</strong> &#8211; Resolved issue when clicking to close the dialog box before the fading animation completes.</p>
<p><strong><a href='http://sandbox.leigeber.com/dialog/dialog_box.html'>View the demo.</a></strong></p>
<p><strong><a href='http://www.leigeber.com/wp-content/uploads/2008/04/dialog.zip'>Download the source.</a></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.leigeber.com/2008/04/custom-javascript-dialog-boxes/feed/</wfw:commentRss>
		<slash:comments>260</slash:comments>
		</item>
	</channel>
</rss>
