user1765862
user1765862

Reputation: 14155

jquery mobile popup message disappear after few seconds

On master page I have

$(document).bind("pageinit", function () {               
     $.mobile.loading('hide');                
});

and I'm rendering popup message like this

$.mobile.loading('show', { theme: "a", text: "My Text...", textonly: true, textVisible: true });

I just need to make this message disappear after 2seconds, right now it stays on top forever.

Upvotes: 0

Views: 566

Answers (1)

Jack
Jack

Reputation: 11003

Just use a timeout to execute the code after whateveer interval you want,

for example

 //display loading message
$.mobile.loading('show', 
   { theme: "a", text: "My Text..."
      , textonly: true, textVisible: true });

   //execute code after 2 seconds
  setTimeout(function () {

    $.mobile.loading('hide');
  },2000);

And here's a link to a jsbin

Upvotes: 1

Related Questions