Skip to content

Instantly share code, notes, and snippets.

@nocodesupplyco
Last active February 12, 2023 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nocodesupplyco/c9462262318be3df9b33e23ccfe55c3f to your computer and use it in GitHub Desktop.
Save nocodesupplyco/c9462262318be3df9b33e23ccfe55c3f to your computer and use it in GitHub Desktop.
Hide/Show Based on Breakpoints and Count of Items
$(function () {
navDesktop();
navTablet();
navMobile();
$(window).resize(navDesktop);
$(window).resize(navTablet);
$(window).resize(navMobile);
});
function navDesktop() {
if ($(window).width() >= 1024) {
// do something
}
}
function navTablet() {
if ($(window).width() < 1024) {
// do something
}
}
function navMobile() {
if ($(window).width() < 768) {
// do something
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment