Skip to content

Instantly share code, notes, and snippets.

@rachelbaker
Created May 16, 2013 01:31
Show Gist options
  • Save rachelbaker/5588758 to your computer and use it in GitHub Desktop.
Save rachelbaker/5588758 to your computer and use it in GitHub Desktop.
jQuery(document).ready(function($) {
function WidthChange(mq) {
if (mq.matches) {
// mobile accordian logic
} else {
// in case you need to add logic for when window width is larger than the mq variable
}
}
if (matchMedia) {
var mq = window.matchMedia("(min-width: 769px)");
mq.addListener(WidthChange);
WidthChange(mq);
}
window.jQuery;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment