1

I have some code which displays a div only when not on a mobile browser by using a Modernizr media query. It works in Firefox (v 19) when the window is manually sized down to a mobile width, but when using the View Responsive Layouts of the Web Developer toolbar, it seems it throws an error which prevents the page from loading. If the Modernizr.mq test is removed, it works fine in View Responsive Layouts. Following is the problematic code ...

function showDiv() {
  $('#old').hide();
  if (!Modernizr.mq('only screen and (max-width: 480px)')) {
    $('#full').show();
  };
  $('#new').show();
}
rhill
  • 226
  • 3
  • 10

0 Answers0