Commit 5292feea05d1fa388ddd504a9a0d1aa2665ec0c9
Merging code for differentiating content based on tags
| | | | 33 | .mr.developer.cfg | 33 | .mr.developer.cfg |
---|
34 | .project | 34 | .project |
---|
35 | .pydevproject | 35 | .pydevproject |
---|
| | 36 | |
---|
| | 37 | *.*~ |
---|
| | | | | | 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 | } |
---|