Guest User

Jquery accordion style menu panel state JavaScript

a guest
Jul 31st, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function displayAccordion() {
  2.  $("#accordion-nav div ul").each(
  3.   function(){
  4.    if ($(this).find('a').filter(
  5.     function(){
  6.      if(window.location.toString().match(/f\?p=\d+:(\d+):/)[1] == $(this).attr('href').match(/f\?p=\d+:(\d+):/)[1] ){
  7.       $(this).addClass('is-lvl2-current');
  8.       return true;
  9.      } else {
  10.       $(this).removeClass('is-lvl2-current');
  11.       return false;
  12.      }
  13.     }).length > 0) {
  14.    $(this).slideDown(1)
  15.    } else {
  16.     $(this).slideUp(1)
  17.    };
  18.   }
  19.  );
  20. }
  21.  
  22. apex.jQuery("#accordion-nav").ready(function(){displayAccordion()});
Add Comment
Please, Sign In to add comment