Skip to content

diogomachado/snackbars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snackbars

Material Vanilla Snackbars (Html, CSS and Javascript)

Show message:

snackbar.show("Hello");

Hide message:

snackbar.hide();

Message after a certain time:

snackbar.timer("Hello", 3000);

Message with button:

// Function example callback
function test(){
  console.info("Cancel button touch!");
}

// Create new button
var button = {};
button.id = "btn_cancel";
button.title = "Cancel";

// Set function callback
snackbar.setCallback(test);

// Call
snackbar.timer("Hello World", 3000, button);

Observations:

  • If your project already uses reset.css, remove the file