setTimeout(function () { showToastMessage("Guest added successfully test2").fadeOut(4000);});
I want to display this message up to 5 sec. but i don't know how to set the display time. I know how to set the delay time. i have used .fade Out method but its not working. i am still in trouble. help me
I want to display this message up to 5 sec. but i don't know how to set the display time. I know how to set the delay time. i have used .fade Out method but its not working. i am still in trouble. help me
setTimeout(function () { showToastMessage("Guest added successfully test2").fadeOut(4000);});
I want to display this message up to 5 sec. but i don't know how to set the display time. I know how to set the delay time. i have used .fade Out method but its not working. i am still in trouble. help me
I want to display this message up to 5 sec. but i don't know how to set the display time. I know how to set the delay time. i have used .fade Out method but its not working. i am still in trouble. help me
Share Improve this question asked Oct 10, 2013 at 13:10 R K SharmaR K Sharma 8759 gold badges23 silver badges43 bronze badges 1- i am using this in jquery Mobile project – R K Sharma Commented Oct 10, 2013 at 13:14
2 Answers
Reset to default 3You can customise the JQuery toaster as you want, it to be.
Not just the time but the look and feel as well, by passing toaster settings as below
$.toaster({ settings : {...} });
For example to set the timeout property you can pass below argument,
$.toaster({ settings : {'timeout': 5000} });
This setting just need to be done only once.You can change the settings at any moment.
Or you can clear all custom changes and revert to the default settings as below
$.toaster.reset();
For other settings options you can visit this link.
I don't know how work showToastMessage function, but it's looks like this function return jQuery object, so you can use .delay method
showToastMessage("Guest added successfully test2")
.delay(5000)
.fadeOut(4000);
or without jQuery magic you can save jQuery toast object and call fadeOut after timeout
var $toast = showToastMessage("Guest added successfully test2");
setTimeout(function(){
$toast.fadeOut(4000);
}, 5000);