gedeltoaster
v0.0.1
Published
Simple toaster. Making toast, and kill it after custom time.
Downloads
5
Readme
Gedel Toaster
Current Version 0.0.1
О Gedel Toaster-е
Простая и легковесная библиотека для JavaScript. Задумывалась как генератор всплывающих окон, тостов, без возможности взаимодействовать с ними.
На данном этапе имеет только один метод, создающий дочерние элементы в родительском. Имеет набор стилей по умолчанию (gedelToaster.css), но также можно использовать свои классы.
Подключение
Подключаем в конце <body></body>
следующим образом:
<body>
...content
<script src="gedelToaster.js"></script>
</body>
Использование
На данный момент доступен только один метод, с помощью которого и происходит вся магия.
GedelToaster.toast(string, time, childrens-class(default: gedel-toast), parent-class(default: gedel-toast));
Передается четыре аргумента, из которых два последних необязательны, если используется стандартная таблица стилей библиотеки.
В первом должна быть строка, которая будет показана пользователю. Во втором число - время жизни элемента в секундах. А два последних представляют собой строки, в которых идет перечисление классов для "className". Третий аргумент - класс\ы дети. Четвертый - класс\ы родителя.
Пример:
GedelToaster.toast("Кнопка была нажата", 3, "gedel-toast", "gedel-toaster");