-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
36 lines (28 loc) · 1.37 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE>
<html>
<head>
<title>Стилизованный alert()</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="alert.css" type="text/css">
<!--[if lt IE 10]><script src="https://cdn.jsdelivr.net/classlist/2014.01.31/classList.min.js"></script><![endif]-->
<script type="text/javascript" src="alert.min.js"></script>
</head>
<body>
<div class="button" data-alert-title="Title" data-alert-content="Content stylesed alert" data-alert-cancel="yes" data-alert-ok-name="YES" data-alert-after-function="alert('Click on close button stylesed alert!')" data-alert-ok-function="alert('Click on OK button stylesed alert!')" data-alert-cancel-function="alert('Click on CANCEL button stylesed alert!')" data-alert-cancel-name="NO">alert with attributes data-*</div>
<br><br>
<div class="button" data-alert-title="Error!!!" data-alert-content="Oh no! A mistake again." data-alert-type="error">alert error</div>
<br> <br>
<div class="button" data-alert-title="Warning!" data-alert-content="Mind the character number." data-alert-type="warning">alert warning</div>
<br><br>
<script>
(function(){
var buttons = document.getElementsByClassName('button');
for (var i = 0; i < buttons.length; i++) {
buttons[i].addEventListener('click', function(){
var newAlert = new Alert(this);
});
};
}());
</script>
</body>
</html>