index.html 1.2 KB

12345678910111213141516171819202122232425262728
  1. <style type="text/css">
  2. #mood{text-align: center;}
  3. #mood ul li,#mood ul li div.pillar{display:inline-block;display:-moz-inline-stack;zoom:1;*display:inline;}
  4. #mood ul li{vertical-align: bottom}
  5. #mood ul li{width:80px; padding-bottom:10px}
  6. #mood ul li span{ font-size:12px}
  7. #mood ul li label{ display:block;}
  8. #mood ul li div.pillar{ height:20px; width:80px; background:url({IMG_PATH}mood/mood.gif) repeat-y 28px center; margin-bottom:5px;}
  9. #mood ul li div.pass{background-position: -83px center;}
  10. </style>
  11. <div id="mood">
  12. <ul>
  13. {loop $setting $k $v}
  14. <li><span>{$data[$v['fields']]}</span><div class="pillar{if isset($key) && $key==$k} pass{/if}" style="height:{$v[per]}px;"></div>{if $v[pic]}<img src="{IMG_PATH}{$v[pic]}">{/if}<br /><label for="n{$k}">{$v[name]}<br /><input type="radio" id="n{$k}" name="n" onclick="vote({$k})" {if isset($key) && $key==$k} checked{/if}></label></li>{/loop}
  15. </ul>
  16. </div>
  17. <script type="text/javascript">
  18. function vote(id) {
  19. $.getJSON('{APP_PATH}index.php?m=mood&c=index&a=post&id={$mood_id}&k='+id+'&'+Math.random()+'&callback=?', function(data){
  20. if(data.status==1) {
  21. $('#mood').html(data.data);
  22. }else {
  23. alert(data.data);
  24. }
  25. })
  26. }
  27. </script>