Skip to content

Instantly share code, notes, and snippets.

@aliirz
Forked from kamranzafar/toast.js
Last active December 11, 2015 03:18
Show Gist options
  • Save aliirz/4536397 to your computer and use it in GitHub Desktop.
Save aliirz/4536397 to your computer and use it in GitHub Desktop.
var toast=function(heading, msg){
$("<div class='ui-loader ui-overlay-shadow ui-body-e ui-corner-all'><h3>"+heading+"</h3><p>"+msg+"</p></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();
});
}
@ObiWan1
Copy link

ObiWan1 commented Aug 5, 2013

This does not work for me. When I try to use it I get the following error:

0x800a138f - JavaScript runtime error: Unable to get property 'pageContainer' of undefined or null reference

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