Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // define click actions for map tab buttons
- jQuery(document).ready(function() {
- // format driving forces content
- $("#driving_forces_list").jcarousel();
- // format questions content
- $("#questions_list").jcarousel();
- // hide sub menu
- $(".subMenuContent").css("visibility", "hidden");
- $(".subMenuContent").css("height", 1);
- $("#options").hide();
- $.fn.showSubMenu = function() {
- // show the subMenuContent div
- $(".subMenuContent").css("visibility", "visible");
- $(".subMenuContent").css("height", 142);
- $("#options").show();
- };
- $.fn.hideSubMenu = function() {
- $().resetContent();
- // show the subMenuContent div
- $(".subMenuContent").css("visibility", "hidden");
- $(".subMenuContent").css("height", 1);
- $("#options").hide();
- };
- $.fn.resetContent = function() {
- $("#options").hide();
- $("#driving_forces").parent().removeClass("active");
- $("#questions").parent().removeClass("active");
- $("#most_popular").parent().removeClass("active");
- $("#my_path").parent().removeClass("active");
- //$(".jcarousel-skin-tango").css("visibility", "hidden");
- $("#driving_forces_content").css("visibility", "hidden");
- $("#questions_content").css("visibility", "hidden");
- $("#most_popular_content").css("visibility", "hidden");
- $("#my_path_content").css("visibility", "hidden");
- };
- $("#options").click(function(event){
- $().hideSubMenu();
- });
- // assign driving forces click event
- $("#driving_forces").click(function(event){
- // hide all of the content in the submenu
- $().resetContent();
- // change the parent li class
- $(this).parent().addClass("active");
- // show driving_forces
- $("#driving_forces_content").css("visibility", "visible");
- // show sub menu
- $().showSubMenu();
- // stop bubbling
- return false;
- });
- // assign questions click event
- $("#questions").click(function(event){
- // hide all of the content in the submenu
- $().resetContent();
- // change the parent li class
- $(this).parent().addClass("active");
- // show driving_forces
- $("#questions_content").css("visibility", "visible");
- // show sub menu
- $().showSubMenu();
- // stop bubbling
- return false;
- });
- // assign questions click event
- $("#most_popular").click(function(event){
- // hide all of the content in the submenu
- $().resetContent();
- // change the parent li class
- $(this).parent().addClass("active");
- // show driving_forces
- $("#most_popular_content").css("visibility", "visible");
- // show sub menu
- $().showSubMenu();
- // stop bubbling
- return false;
- });
- // assign questions click event
- $("#my_path").click(function(event){
- // hide all of the content in the submenu
- $().resetContent();
- // change the parent li class
- $(this).parent().addClass("active");
- // show driving_forces
- $("#my_path_content").css("visibility", "visible");
- // show sub menu
- $().showSubMenu();
- // stop bubbling
- return false;
- });
- });
Add Comment
Please, Sign In to add comment