Modernizr/Modernizr — Issue #506: Modernizr.mq breaks JavaScript in IE9
Author: ianperrettive
Created: 2012-02-17 11:29:10+00:00
State: open

I am using Modernizr.mq in a resize function
In IE9 the click event stops working after the Modernizr.mq is called - work in Chrome and FF
see code below:

$(document).ready(function() {
$(window).resize(function(){
screen_size = "small";
if ( Modernizr.mq('only screen and (min-width : 700px)') ){
screen_size = "large";
};
log(screen_size);
}).resize();

$("#btn").click(function(){
log("clicked");
})
});

adding the live function to the click - makes it work again:

$("#btn").live("click",function(){
log("clicked");
})

Apologies if this is not the right place to post this or it is in the wrong place or I am doing something stupid