JavaScript codes for Web DEV

Nice AJAX Effects for Messages Box using MooTools

This is very simple JavaScript code example but it can create an amazing message box effect with AJAX operations, bases on ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes


How to setup

Step 1: Copy & Paste CSS code below in your HEAD section
CSS
Code:
<style type="text/css">
body{font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; font-size:12px;}
#box {
	margin-bottom:10px;
	width: auto;
	padding:4px;
	border:solid 1px #DEDEDE;
	background: #FFFFCC;
	display:none;
}
</style>
Step 2: Use JavaScript code below to setup the script
JavaScript
Code:
<script type="text/javascript" src="mootools.js"></script>
<script type="text/javascript">
// Created by Antonio Lupetti | http://woork.blogspot.com
// This script downloaded from www.JavaScriptBank.com
window.addEvent('domready', function(){
	var box = $('box');
	var fx = box.effects({duration: 1000, transition: Fx.Transitions.Quart.easeOut});
	
	$('save_button').addEvent('click', function() {
		box.style.display="block";
		box.setHTML('Save in progress...');
		
		/* AJAX Request here... */
		
		fx.start({	
			}).chain(function() {
				box.setHTML('Saved!');
				this.start.delay(1000, this, {'opacity': 0});
			}).chain(function() {
				box.style.display="none";
				this.start.delay(0001, this, {'opacity': 1});
			});
		});
	}); 
</script>
Step 3: Place HTML below in your BODY section
HTML
Code:
Press &quot;Save&quot;</p>
<div id="box"></div>
<input name="" type="text" /><input id="save_button" name="save_button" type="button" value="save"/>
Step 4: Download files below
Files
mootools.js






JavaScript Countdown Timer - JavaScript Web based Music Player - JavaScript AJAX Page Content Loader
Quote Originally Posted by Copyright
The Site may provide, or third parties may provide, links to non-JavaScriptBank.com Internet World Wide Web sites or resources. Because JavaScriptBank.com has no control over such sites and resources, you acknowledge and agree that JavaScriptBank.com is not responsible for the availability of such external sites or resources, and does not endorse and is not responsible or liable for any content, advertising, products, or other materials on or available from such sites or resources. You further acknowledge and agree that JavaScriptBank.com shall not be responsible or liable, directly or indirectly, for any damage or loss caused or alleged to be caused by or in connection with use of or reliance on any such content, goods or services available on or through any such site or resource.