$(document).ready(function () { //hide the all of the elements with class answer $(".answer").hide(); $(".answer_nested").hide(); //toggle the componenet with class answer $(".question").click(function () { $(this).next(".answer").slideToggle(250); }); $(".question_nested").click(function () { $(this).next(".answer_nested").slideToggle(250); }); $(".collapseAll").click(function () { $(".answer").hide(250); $(".answer_nested").hide(250); }); $(".expandAll").click(function () { $(".answer").show(250); $(".answer_nested").show(250); }); }); /* This function removes unnecessary aria-roles, while injecting a needed one into accordions. */ $(document).ready(function () { // removing role attribute to fix accessibilty error //$("nav#navigation.singlelevel a").removeAttr("role aria-expanded"); $(".toggleAccordion").removeAttr("role aria-hidden"); $(".accordion").removeAttr("role tablist"); $(".panel-default").removeAttr("role presentation"); $(".panel-heading").removeAttr("role presentation"); $(".panel-title a").removeAttr("role tab"); $(".panel-title a").removeAttr("role aria-selected"); $(".accordion").removeAttr("role aria-multiselectable"); $(".collapsed").removeAttr("role aria-selected"); $(".panel-collapse").removeAttr("tabindex"); $(".toggleAccordion").attr("role", "region"); $(window).resize(function () { $("nav#navigation.singlelevel a").removeAttr("role aria-expanded"); }); }); /* This function removes unnecessary aria-roles from tab panels */ $(document).ready(function () { $("#tabs li.nav-item").removeAttr("role presentation"); $(".tab-pane").removeAttr("role aria-hidden"); $(".tab-pane div.card-body").removeAttr("role presentation"); $(".tab-pane h2").removeAttr("role presentation"); $(".tab-pane h3").removeAttr("role presentation"); $(".tab-pane h4").removeAttr("role presentation"); $("#collapse-home").removeAttr("role aria-hidden"); $("#collapse-profile").removeAttr("role aria-hidden"); $("#collapse-messages").removeAttr("role aria-hidden"); $(".collapse.show").removeAttr("role aria-hidden"); //$("#tabs li").attr("role", "listitem"); //$(".toggleAccordion").attr("role", "region"); //$(window).resize(function() { // $("nav#navigation.singlelevel a").removeAttr("role aria-expanded"); //}); }); /* This function can be used to toggle aria-expanded values */ function expandedValues() { var x = document.getElementById("searchExpand").getAttribute("aria-expanded"); if (x == "true") { x = "false"; document.getElementById("searchExpand").focus(); } else { x = "true"; } document.getElementById("searchExpand").setAttribute("aria-expanded", x); } /*----------------------------------------- Custom code for expanding and collapsing accordions ---------------------------------------*/ function expand() { $('.toggleAccordion').collapse('show'); } function collapse() { $('.toggleAccordion').collapse('hide'); } /*--initialize modal plugin for Bootstrap--*/ //$('#myModal').modal(options); /*bootstrap datepicker customizing*/ //$('#sandbox-container input').datepicker({ // todayHighlight: true //});