Reputation: 8608
Consider the following code that opens an infowindow in google maps:
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
Question: How can I disable the infowindow from showing if the window width is less than 900px?
I still want the code to work at widths above 900px.
Upvotes: 0
Views: 63
Reputation: 10627
Try, something like:
google.maps.event.addListener(marker, 'click', function(){
var ww = outerWidth || document.body.offsetWidth;
if(ww > 900){
infowindow.open(map, marker);
}
});
Upvotes: 1