Skip to content

Instantly share code, notes, and snippets.

@astockwell
Created October 24, 2013 20:03
Show Gist options
  • Save astockwell/7144031 to your computer and use it in GitHub Desktop.
Save astockwell/7144031 to your computer and use it in GitHub Desktop.
Enquire! "True" on line 46 activates this breakpoint for non-supporting browsers (IE!!!).
// ========================================================================== //
// Media Query JS support
// ========================================================================== //
$(function(){
mq_desktop = 620;
// Initial setup (all breakpoints)
$(document).ready(function() {
// Setup learnmore blocks
$('.learnmore').hide();
});
// Mobile breakpoint
enquire.register("screen and (max-width: " + (mq_desktop-1) + "px)", {
match : function() {
$('.mobile-links').click(function(e){
e.preventDefault();
$(this).next().slideToggle();
});
},
unmatch : function() {
$('.mobile-links').off();
}
});
// Desktop breakpoint
enquire.register("screen and (min-width: " + mq_desktop + "px)", {
match : function() {
// Fix iPad Orientation
// checkOrientationforiPad();
// Initialize Desktop
sidepages();
show_scroll_down_icon();
// Start the SHOW :)
fluidic_initialize();
},
unmatch : function() {
// alert('leaving desktop size');
},
setup : function() {
//ajax load desktop js file (opt)
},
deferSetup : true
}, true);
// Parallax breakpoint (> iPad dimensions)
enquire.register("screen and (min-width: 1025px)", {
match : parallax_backgrounds
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment