jxycms
11/2/2016 - 4:05 AM

/* This section of code is used to make users input the url of accordion and browser will scoll to accordion automatically and open it */

/* This section of code is used to make users input the url of accordion and browser will scoll to accordion automatically and open it */

//o gets the url string what users input, 
o = window.location.href.toString();
    //judge whether the url is a accordion url
    if (o.match('#')){
      //get the string after "#" in the url and this is also known as css ID of accordion
      /*check css of accordion to find rules when open and close accordion*/
      $('#'+ o.split('#')[1]).toggleClass("in");
      $('#'+ o.split('#')[1]).attr('aria-hidden', function(){
          !$('#'+ o.split('#')[1]).attr('aria-hidden');
      });
      $('#'+ o.split('#')[1]).prev().toggleClass("active");
      $('#'+ o.split('#')[1]).attr('style', 'height: auto;');
      
    }