CodeSeven / toastr

Simple javascript toast notifications

Home Page:http://www.toastrjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I want to get the custom parameter when onclick

itren9 opened this issue · comments

Hello,
I want to get the custom parameter when onclick, the parameter is hidden, not shown in the page, can you implement it?How to do that

commented

try overriding the onclick event

$.extend(
  toastr.options,
  {
    tapToDismiss: true,
    timeOut: 0,
    extendedTimeOut: 0,
    onclick: function() { alert("default callback") }
  }
);

toastr.info("info");
toastr.success('success',null,{
 	onclick: function() { 
   	alert("you clicked on success");
  }
});
toastr.error('error',null,{
 	onclick: function() { 
   	alert("you clicked on error");
  }
});
toastr.warning('warning',null,{
 	onclick: function() { 
   	alert("you clicked on warning");
  }
});