Guest User

Untitled

a guest
Feb 21st, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.07 KB | None | 0 0
  1. // define click actions for map tab buttons
  2. jQuery(document).ready(function() {
  3.  
  4. // format driving forces content
  5. $("#driving_forces_list").jcarousel();
  6.  
  7. // format questions content
  8. $("#questions_list").jcarousel();
  9.  
  10. // hide sub menu
  11. $(".subMenuContent").css("visibility", "hidden");
  12. $(".subMenuContent").css("height", 1);
  13. $("#options").hide();
  14.  
  15. $.fn.showSubMenu = function() {
  16. // show the subMenuContent div
  17. $(".subMenuContent").css("visibility", "visible");
  18. $(".subMenuContent").css("height", 142);
  19. $("#options").show();
  20. };
  21.  
  22. $.fn.hideSubMenu = function() {
  23. $().resetContent();
  24. // show the subMenuContent div
  25. $(".subMenuContent").css("visibility", "hidden");
  26. $(".subMenuContent").css("height", 1);
  27. $("#options").hide();
  28. };
  29.  
  30. $.fn.resetContent = function() {
  31. $("#options").hide();
  32. $("#driving_forces").parent().removeClass("active");
  33. $("#questions").parent().removeClass("active");
  34. $("#most_popular").parent().removeClass("active");
  35. $("#my_path").parent().removeClass("active");
  36. //$(".jcarousel-skin-tango").css("visibility", "hidden");
  37. $("#driving_forces_content").css("visibility", "hidden");
  38. $("#questions_content").css("visibility", "hidden");
  39. $("#most_popular_content").css("visibility", "hidden");
  40. $("#my_path_content").css("visibility", "hidden");
  41. };
  42.  
  43. $("#options").click(function(event){
  44. $().hideSubMenu();
  45. });
  46.  
  47. // assign driving forces click event
  48. $("#driving_forces").click(function(event){
  49. // hide all of the content in the submenu
  50. $().resetContent();
  51. // change the parent li class
  52. $(this).parent().addClass("active");
  53. // show driving_forces
  54. $("#driving_forces_content").css("visibility", "visible");
  55. // show sub menu
  56. $().showSubMenu();
  57. // stop bubbling
  58. return false;
  59. });
  60.  
  61. // assign questions click event
  62. $("#questions").click(function(event){
  63. // hide all of the content in the submenu
  64. $().resetContent();
  65. // change the parent li class
  66. $(this).parent().addClass("active");
  67. // show driving_forces
  68. $("#questions_content").css("visibility", "visible");
  69. // show sub menu
  70. $().showSubMenu();
  71. // stop bubbling
  72. return false;
  73. });
  74.  
  75. // assign questions click event
  76. $("#most_popular").click(function(event){
  77. // hide all of the content in the submenu
  78. $().resetContent();
  79. // change the parent li class
  80. $(this).parent().addClass("active");
  81. // show driving_forces
  82. $("#most_popular_content").css("visibility", "visible");
  83. // show sub menu
  84. $().showSubMenu();
  85. // stop bubbling
  86. return false;
  87. });
  88.  
  89. // assign questions click event
  90. $("#my_path").click(function(event){
  91. // hide all of the content in the submenu
  92. $().resetContent();
  93. // change the parent li class
  94. $(this).parent().addClass("active");
  95. // show driving_forces
  96. $("#my_path_content").css("visibility", "visible");
  97. // show sub menu
  98. $().showSubMenu();
  99. // stop bubbling
  100. return false;
  101. });
  102. });
Add Comment
Please, Sign In to add comment