I am trying to automatically open a Foundation 6 accordion using JavaScript when the window size is larger than 640px. Despite researching various posts on the Foundation forum and StackOverflow related to accordions, I have not been successful in resolving this issue.
Below is my most recent code: http://codepen.io/rogetmone/pen/VaJNVw
$(document).foundation();
$(document).ready(function() {
var windowWidth = $(window).width();
if (windowWidth > 640) {
$('#blackberry-recipes').addClass('is-active');
}
});
I would greatly appreciate any assistance with this matter!