-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
43 lines (41 loc) · 1.27 KB
/
test.html
File metadata and controls
43 lines (41 loc) · 1.27 KB
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
37
38
39
40
41
42
43
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>ELEMENTATION | Example</title>
<script src="elementation.js"></script>
</head>
<body>
<div class="elementation">CLICKER CLASS</div>
<div class="elementation">CLICKER CLASS</div>
<div class="elementation">CLICKER CLASS</div>
<script type="text/javascript">
ELM.act(
'.elementation',
'click',
// pre clicked function
function (props) {
// console.log(props.e) // can access event
// console.log(props.el) // can access element
console.log('i am triggered before action is triggered')
return 'Pre response'
},
// clicked action function
function (e, el, props) {
// console.log(props.preResponse) // can access pre response returned value
console.log('clicked')
return 'hi'
},
// post clicked function
function (props) {
// console.log(props.actionResponse) // can access action response returned value
console.log('i am triggered after action is triggered')
return 'post action response'
}
)
// ELM.actionResponse -> has response from post function
</script>
</body>
</html>