actividades.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. function showPastActivity(id){
  2. console.log("Current max-height: " + document.getElementById("past_activity_details_" + id).clientHeight);
  3. if (document.getElementById("past_activity_details_" + id).clientHeight > 0){
  4. document.getElementById("past_activity_details_" + id).style.maxHeight = '0em';
  5. setTimeout(function(){document.getElementById('slid_past_activity_' + id).src = '/img/misc/slid-right.png';}, 500);
  6. }
  7. else{
  8. document.getElementById('past_activity_details_' + id).style.maxHeight = '40em';
  9. setTimeout(function(){document.getElementById('slid_past_activity_' + id).src = '/img/misc/slid-down.png';}, 500);
  10. }
  11. document.getElementById('slid_past_activity_' + id).style.opacity = '0';
  12. setTimeout(function(){document.getElementById('slid_past_activity_' + id).style.opacity = '1';}, 500);
  13. }
  14. //Archive
  15. function toggleElement(name){
  16. if (document.getElementById("list_" + name).clientHeight > 0){
  17. document.getElementById("list_" + name).style.maxHeight = '0em';
  18. setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-right.png';}, 500);
  19. }
  20. else{
  21. document.getElementById("list_" + name).style.maxHeight = '90em';
  22. setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-down.png';}, 500);
  23. }
  24. document.getElementById('slid_' + name).style.opacity = '0';
  25. setTimeout(function(){document.getElementById('slid_' + name).style.opacity = '1';}, 500);
  26. /*if (document.getElementById("list_" + name).style.display == 'block'){
  27. document.getElementById("list_" + name).style.display = 'none';
  28. document.getElementById("slid_" + name).src = '/img/misc/slid-right.png';
  29. }
  30. else{
  31. document.getElementById("list_" + name).style.display = 'block';
  32. document.getElementById("slid_" + name).src = '/img/misc/slid-down.png';
  33. }*/
  34. }