Điểm qua nilbuild/jquery-toast-plugin: 1.5k sao trên GitHub, viết chủ yếu bằng JavaScript. Highly customizable jquery plugin to show toast messages
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
A plugin to show highly customizable notifications to the user.
How to use
You can install the plugin via Bower:
bower install jquery-toast-plugin
or via npm
npm install jquery-toast-plugin
Or directly download the repository and place the content of dist wherever you can access them.
Include the CSS and JS files.
Simply do $.toast('Toast message to be shown') Of course it would be the world's simplest toast message but believe me you can do a lot more with the options.
Demo
For some quick demos and a detailed documentation accompanied by the demos for each of the available options can be accessed through http://kamranahmed.info/toast
Quick usage examples
Simple textual toast
// Non sticky version
$.toast("Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic, consequuntur doloremque eveniet eius eaque dicta repudiandae illo ullam. Minima itaque sint magnam dolorum asperiores repudiandae dignissimos expedita, voluptatum vitae velit.")
// Sticky version
$.toast({
text : "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic, consequuntur doloremque eveniet eius eaque dicta repudiandae illo ullam. Minima itaque sint magnam dolorum asperiores repudiandae dignissimos expedita, voluptatum vitae velit.",
hideAfter : false
})
Toast using HTML as a text
// Non sticky
$.toast("Let's test some HTML stuff... <a href='#'>github</a>")
// sticky
$.toast({
text : "<strong>Remember!</strong> You can <span style='font-weight: bold; color:red;' class='horribly-styled'>always</span> introduce your own × HTML and <span style='font-size: 18px;'>CSS</span> in the toast.",
hideAfter : false
})
Unordered list elements as the text of toast using array
// Non sticky version
$.toast(["Ubuntu : One of it's kind", "Sublime Text : Productivity unleashed", "HeidiSQL : Just love it", "Github : Just Lovely"])
// Sticky version
$.toast({
text : ["Ubuntu : One of it's kind", "Sublime Text : Productivity unleashed", "HeidiSQL : Just love it", "Github : Just Lovely"],
hideAfter : false
})
Changing the animations
$.toast({
text : "Let's test some HTML stuff... <a href='#'>github</a>",
showHideTransition : 'slide' // It can be plain, fade or slide
})
Changing the formatting
$.toast({
text : "Let's test some HTML stuff... <a href='#'>github</a>",
showHideTransition : 'slide', // It can be plain, fade or slide
bgColor : 'blue', // Background color for toast
textColor : '#eee', // text color
allowToastClose : false, // Show the close button or not
hideAfter : 5000, // `false` to make it sticky or time in miliseconds to hide after
stack : 5, // `fakse` to show one stack at a time count showing the number of toasts that can be shown at once
textAlign : 'left', // Alignment of text i.e. left, right, center
position : 'bottom-left' // bottom-left or bottom-right or bottom-center or top-left or top-right or top-center or mid-center or an object representing the left, right, top, bottom values to position the toast on page
})
Resetting the toast
var myToast = $.toast('Some toast that needs to be removed.');
myToast.reset(); // remove the toast "Some toast that needs to be removed"
What if I want to reset all the toasts at once? You may ask. Well in that case, you can do the following:
$.toast().reset('all');
Updating the toast
Suppose, you had shown some toast upon the page, a sticky toast for example and now you want to update the toast. You can do the following
var myToast = $.toast({
text : 'Some toast that needs to show the success message after the ajax call.',
hideAfter : false,
bgColor : '#E01A31'
});
window.setTimeout(function(){
myToast.update({
text : '<strong>Updated after a few seconds</strong>',
bgColor : '#23B65D'
});
}, 5000);
To learn more about how to use and customize it, head to http://kamranahmed.info/toast. Also you can find a customizer there that will let you modify the look and feel of the toast however you like it.
You can simply download the repo or if you are in rush the minified CSS or non-minified CSS can be found and minified JS and non minified JS can also be found.
Features
Show different types of toasts i.e. informational, warning, errors and success
Custom toast background color and text color
Ability to hack the CSS to add your own thing
Text can be provided in the form of
Array (It's elements will be changed to an un ordered list)
Simple text
HTML
Events support i.e. beforeHide, afterHidden, beforeShow, afterShown
Fade and Slide show/hide transitions support (More to come)
Supports showing the loader for the toast
You can position the toast, wherever you want there is support for top-left, top-rightbottom-left and bottom-right, top-center, bottom-center and mid-center ...sighs! That's a whole lot of options, isn't it? No, you say. Ok then here is the most exciting thing, you can also introduce your own positioning just by passing a simple js object containing { top: - , bottom: -, left: -, right: - }
Ability to add sticky toast
Optional stack length can be defined (i.e. maximum number of toasts that can be shown at once)
Please report any bugs or features you would like added.
nilbuild/jquery-toast-plugin có 1.5k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/nilbuild/jquery-toast-plugin. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
nilbuild/jquery-toast-plugin có những chủ đề gì?
GitHub topics của nilbuild/jquery-toast-plugin: "growl", "growl-notifications", "jquery-toast-plugin", "notifications", "toast", "toast-message", "toastr". TopGit xếp repo vào nhóm mã nguồn mở.
nilbuild/jquery-toast-plugin còn đang phát triển không?
Commit gần nhất trên nilbuild/jquery-toast-plugin là 4.2 năm trước (theo timestamp GitHub). Repo có 498 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
nilbuild/jquery-toast-plugin là gì?
nilbuild/jquery-toast-plugin (nilbuild/jquery-toast-plugin) là dự án JavaScript trên GitHub. Theo mô tả gốc: Highly customizable jquery plugin to show toast messages
nilbuild/jquery-toast-plugin viết bằng ngôn ngữ gì?
nilbuild/jquery-toast-plugin chủ yếu viết bằng JavaScript. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
Vẫn đang phân vân về jquery-toast-plugin?
Một cú bấm sẽ gửi câu hỏi kèm trang này cho AI — xem AI nói gì về jquery-toast-plugin.