-
Notifications
You must be signed in to change notification settings - Fork 12
/
example4.html
83 lines (80 loc) · 2.26 KB
/
example4.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
* {
box-sizing: border-box;
}
.row::after {
content: "";
clear: both;
display: table;
}
[class*="col-"] {
float: left;
padding: 15px;
border: solid 1px #e4e4e4;
}
.col-1 {width: 8.33%;}
.col-2 {width: 16.66%;}
.col-3 {width: 25%;}
.col-4 {width: 33.33%;}
.col-5 {width: 41.66%;}
.col-6 {width: 50%;}
.col-7 {width: 58.33%;}
.col-8 {width: 66.66%;}
.col-9 {width: 75%;}
.col-10 {width: 83.33%;}
.col-11 {width: 91.66%;}
.col-12 {width: 100%;}
</style>
<script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<script src="js/jquery.miranda.js"></script>
<script>
$( document ).ready(function() {
var data = {
"people": [{
"name": "Fabiano",
"lastname": "Miranda",
"office": "Server-side Programmer"
}, {
"name": "Elder",
"lastname": "Beat",
"office": "Front-side Programmer"
}],
"company": [{
"name": "Original media",
"country": "Brasil"
}, {
"name": "Apple",
"country": "United States"
}]
};
$("#peopleWork").mirandajs(data, {
containers:['peopleWork', 'companyWork'],
jsonNode:['people', 'company']
});
});
</script>
</head>
<body>
<h2>People</h2>
<div id="peopleWork" style="display: none;">
<div class="row">
<div class="col-4">[[name]]</div>
<div class="col-4">[[lastname]]</div>
<div class="col-4">[[office]]</div>
</div>
</div>
<h2>Company</h2>
<div id="companyWork" style="display: none;">
<div class="row">
<div class="col-6">[[name]]</div>
<div class="col-6">[[country]]</div>
</div>
</div>
</body>
</html>