Skip to content

vitozyf/web-notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

notify

introduction

// according to your deployment
<link href="dist/assets/notify/notify.css" rel="stylesheet" type="text/css" />
<script src="dist/assets/notify/notify.js"></script>

use

	ms_notify(selector, options)

the selector parameter is a HTMLElement or string passed into the querySelector. The default configuration for the options parameter is shown below.

// demo
<div id="demo">
	message
</div>
<script>
		window.onload = () => {
			var notify = window.ms_notify('#demo' , {
				delay: 5000
			})
			notify.show();
		}
</script>

default options

{
	width: 320,
	height: 188,
	offset: 20,
	delay: 5000, // ms
	placement: 'bottom-right', // bottom-right bottom-left top-right top-left
	direction: 'toTop', // toTop toLeft toBottom toRight
	timingFunction: 'ease', // linear ease ease-in ease-in-out ease-out step-start step-end
	message: '还有 #{delay}S 关闭' // tip text
}
  • totice the correspondence
placement direction
bottom-right toTop, toLeft
bottom-left toTop, toRight
top-right toLeft, toBottom
top-left toRight, toBottom

api

  • show
  • hide

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published