Commit 5292feea05d1fa388ddd504a9a0d1aa2665ec0c9
- Diff rendering mode:
- inline
- side by side
.gitignore
(2 / 0)
  | |||
33 | 33 | .mr.developer.cfg | |
34 | 34 | .project | |
35 | 35 | .pydevproject | |
36 | |||
37 | *.*~ |
js/main.js
(19 / 0)
  | |||
1 | var template = _.template($('#image-template').html()); | ||
2 | $("#select").on('change',onSelectChange); | ||
3 | M = {}; | ||
4 | $.getJSON("http://localhost:60/js/maraa.json",function(data){ | ||
5 | M = data; | ||
6 | _.each(data.image_list, function(item) { | ||
7 | if(item.tag == "CR") | ||
8 | x = $('#imgs').append(template({ | ||
9 | img: item.image | ||
10 | }))}); | ||
11 | }); | ||
12 | function onSelectChange(e){ | ||
13 | $("#imgs").html(''); | ||
14 | _.each(M.image_list, function(item) { | ||
15 | if(item.tag == e.currentTarget.value) | ||
16 | x = $('#imgs').append(template({ | ||
17 | img: item.image | ||
18 | }));}); | ||
19 | } |