Skip to content

Instantly share code, notes, and snippets.

@kamranzafar
Created July 18, 2012 14:40
Show Gist options
  • Star 38 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save kamranzafar/3136584 to your computer and use it in GitHub Desktop.
Save kamranzafar/3136584 to your computer and use it in GitHub Desktop.
JQuery Mobile Android-style Toast popup
var toast=function(msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+msg+"</h3></div>")
.css({ display: "block",
opacity: 0.90,
position: "fixed",
padding: "7px",
"text-align": "center",
width: "270px",
left: ($(window).width() - 284)/2,
top: $(window).height()/2 })
.appendTo( $.mobile.pageContainer ).delay( 1500 )
.fadeOut( 400, function(){
$(this).remove();
});
}
@imspikey
Copy link

Thank you nice work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment