Bones/scripts/skeletonMatchMedia.js
Alphan Gunayin 1d5d5b8d04 Display matching media query and browser width/height.
Display matching media query and browser width/height at the bottom of the viewport.
2012-07-24 14:12:43 -04:00

17 lines
674 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

$(function(){
// Window load and resize.
$(window).bind('load resize', function() {
if(debug){
if(window.matchMedia("(min-width: 768px) and (max-width: 959px)").matches){
$('#debug').html("Tablet (Portrait)");
} else if(window.matchMedia("(min-width: 480px) and (max-width: 767px)").matches){
$('#debug').html("Mobile (Landscape)");
} else if(window.matchMedia("(max-width: 767px)").matches){
$('#debug').html("Mobile (Portrait)");
} else{
$('#debug').html("Desktop & Tablet (Landscape)");
}
$('#debug').append(" ("+ $(window).width() + ' x '+ $(window).height() +')px');
}
});
});