Monday 13 May 2013
Facebook StumbleUpon Twitter Google+ Pin It

Twitter Like Flash Message with jQuery


I like Twitter API method displaying information message in flash style. I had developed a small web application like twitter flash message using jQuery. It's useful and simple just enrich your web projects.


Javascript Code:
You have to modify setTimeout() value.
<script type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.0/jquery.min.js">
</script>
<script type="text/javascript" >
 $(document).ready(function(){
setTimeout(function(){
$(".flash").fadeOut("slow", function () {
$(".flash").remove();
}); }, 2000);
});
</script>

flash.php
Contains PHP and HTML Code.

<?php

if($_SERVER["REQUEST_METHOD"] == "POST")
{
// Some data....
$message="<div class='flash'> Information message !</div>";
}

?>


<div align="center">>
<?php echo $message; ?>
</div>


Style Sheet
CSS code.

.flash{

width:759px;
padding-top:8px;
padding-bottom:8px;
background-color: #fff;
font-weight:bold;
font-size:20px;-moz-border-radius: 6px;-webkit-border-radius: 6px;

}

Parthiv Patel
Bhaishri Info Solution
Sr. PHP Developer
Limdi Chowk, AT PO. Nar, Di. Anand
Nar, Gujarat
388150
India
pparthiv2412@gmail.com
7383343029
DOB: 12/24/1986

No comments: