Skip to content

Commit

Permalink
Updated media query to support Android 2.3 (gingerbread)
Browse files Browse the repository at this point in the history
- window.matchMedia does not work on Android 2.3 (Gingerbread), so use $(window).width()
  • Loading branch information
Mike King committed Apr 12, 2012
1 parent 096e8f6 commit 9c9928c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions jQuery.menutron.js
Expand Up @@ -55,7 +55,7 @@
// $(selectMenu).prepend(menuTitle);
//}

var menuTitle = ['<option selected="selected" value>Choose...</option>'].join("");
var menuTitle = '<option selected="selected" value>Choose...</option>';

// Appends the newly created list to menu's container element
$(selectMenu).prepend(menuTitle);
Expand All @@ -74,7 +74,8 @@
function transformMenu() {

// Media query for device screens (default: 600px)
if (window.matchMedia(screenWidth).matches) {
// *Note, window.matchMedia does not work on Android 2.3 (Gingerbread)
if (window.matchMedia(screenWidth).matches || $(window).width() <= options.maxScreenWidth) {

// Hides the original menu list from the display
$(selectMenu).css("display", "inline-block");
Expand Down

0 comments on commit 9c9928c

Please sign in to comment.