我正在使用jquery toastr。到目前为止,一切都很好。我可以显示和关闭敬酒罚款。 我希望能够唯一标识每个烤面包。并在onHidden函数中使用该唯一标识符。有没有人做过这个?关闭toast封闭的toast的toastr类或div的关闭事件是更好的选择吗?jquery toastr on隐藏函数
var mes = 'My name is Inigo Montoya.<input type="hidden" id="announcementId" value="1"/>' +
'<input type="hidden" id="userId" value="'+ userid +'"/> ';
var mes1 = 'Princess Bride<input type="hidden" id="announcementId2" value="2"/>'+
'<input type="hidden" id="userId1" value="'+ userid +'"/> ';
var mes2 = 'Man in Black<input type="hidden" id="announcementId2" value="3"/>'+
'<input type="hidden" id="userId2" value="'+ userid +'"/> ';
var mes3 = 'Inconcivable!<input type="hidden" id="announcementId3" value="4"/>'+
'<input type="hidden" id="userId3" value="'+ userid +'"/> ';
toastr.options = {
"closeButton": false,
"debug": false,
"positionClass": "toast-top-full-width",
"showDuration": "300",
"hideDuration": "1000",
"timeOut": "0",
"extendedTimeOut": "0",
"showEasing": "swing",
"hideEasing": "linear",
"showMethod": "fadeIn",
"hideMethod": "fadeOut"
};
toastr.options.onHidden = function(item) {
//GET UNIQUE TOAST ID'S HERE
var val = 1;//$this.find("#announcemntId").val();
alert("CLOSED " + item);
}
toastr.error(mes, "First Toast");
toastr.error(mes1, "Second Toast");
toastr.error(mes2, "Third Toast");
toastr.error(mes3, "Fourth Toast");
感谢抬头得到根本干杯!将考虑所有关于未来用途的内容! – phattyD 2014-09-18 00:57:30