Skip to content

Instantly share code, notes, and snippets.

@vlaube
Created May 9, 2011 13:33
Show Gist options
  • Save vlaube/962525 to your computer and use it in GitHub Desktop.
Save vlaube/962525 to your computer and use it in GitHub Desktop.
Alerts
<html>
<head>
<style type="text/css">
body{
margin: 0;
font-family: helvetica;
font-size: 12px;
}
#loadingIndicator{
position: relative;
left: 50%;
top: -43px;
background-color: #BBFFB6;
padding: 3px 30px 5px 30px;
-webkit-border-bottom-right-radius: 10px;
-webkit-border-bottom-left-radius: 10px;
-moz-border-radius-bottomright: 10px;
-moz-border-radius-bottomleft: 10px;
border-bottom-right-radius: 10px;
border-bottom-left-radius: 10px;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#bt_teste").click(showIndicator);
if ($("#loadingIndicator").length > 0){
showIndicator();
}
});
function showIndicator(){
$("#loadingIndicator").animate({top: 0}, 500, function(){
setTimeout( hideIndicator,5000);
});
}
function hideIndicator(){
$("#loadingIndicator").stop().animate({top:-43}, 500);
}
</script>
</head>
<body>
<div style="float:right; position:relative; left:-50%; top:0; text-align:left; height:0;">
<div id="loadingIndicator" style="position: relative; left: 50%; display: block; top: -43px; ">
Item gravado com sucesso!
</div>
</div>
<input type="button" id="bt_teste" value="Teste" />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment