Reputation: 1772
I'm experimenting with Materialize Toasts in my new project. I can't get Toasts to display at all. Firebug debugging indicates that no toast function could be found, but I don't understand why.
I am trying to call the toast like this:
%a.btn{:onclick => "toast('I am a toast', 4000)"} Toast!
All my other Javascript components are working. I expected Toast to work the same as I'm importing all the Javascript components from the Materialize library. Has anybody encountered a similar issue using this CSS framework?
Upvotes: 0
Views: 6233
Reputation: 1772
In case anybody else has some trouble getting toasts to work. It needs to be initialized like follows (As per updated documentation):
"Materialize.toast('Hallo World', 4000)"
and not like the example given in my question.
Upvotes: 2
Reputation: 1
You also have to initialize your toast, if this one is generated dynammically by using :
$(document).ready(function(){
$('.tooltipped').tooltip({delay: 50});
});
More informations about toasts right here : http://materializecss.com/dialogs.html
Upvotes: 0
Reputation: 1
Update to the last Version of the materializeCss JS file (my version js file is 0.96) on github https://github.com/Dogfalo/materialize
Upvotes: 0