I have a menu with multiple jQuery toggles in it and I wanted to have jQuery toggle open one if the page URL matched. I guessed that I would need an array to keep the code short, but I know I'm doing something wrong.
$(function() {
var pathname = window.location.pathname;
var myWhoweare = new Array("history.asp","corporate_profile.asp");
if(jQuery.inArray(pathname, myWhoweare) !== -1) {
$('div.accordian_whoweare> div').show();
}
});
I'm pretty sure that my error is in how the array is created (there are two URLs in it for this test, there will be more later) and detected.
Any help would be appreciated.