mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-30 02:44:44 +00:00
set max-width breakpoint classes as well.
This commit is contained in:
parent
f806fc07d7
commit
6d54740f41
1 changed files with 8 additions and 3 deletions
|
|
@ -403,17 +403,22 @@
|
|||
function resolutionBreakpoints(){
|
||||
var currWidth = $window.width(),
|
||||
minPrefix = "min-width-",
|
||||
minBreakpoints = [];
|
||||
maxPrefix = "max-width-",
|
||||
minBreakpoints = [],
|
||||
maxBreakpoints = [];
|
||||
|
||||
$html.removeClass( minPrefix + $.mobile.resolutionBreakpoints.join(" " + minPrefix) );
|
||||
$html.removeClass( minPrefix + $.mobile.resolutionBreakpoints.join(" " + minPrefix) + maxPrefix + " " + $.mobile.resolutionBreakpoints.join(" " + maxPrefix) );
|
||||
|
||||
$.each($.mobile.resolutionBreakpoints,function( i ){
|
||||
if( currWidth >= $.mobile.resolutionBreakpoints[ i ] ){
|
||||
minBreakpoints.push( $.mobile.resolutionBreakpoints[ i ] );
|
||||
}
|
||||
if( currWidth <= $.mobile.resolutionBreakpoints[ i ] ){
|
||||
maxBreakpoints.push( $.mobile.resolutionBreakpoints[ i ] );
|
||||
}
|
||||
});
|
||||
|
||||
$html.addClass( minPrefix + minBreakpoints.join(" " + minPrefix) );
|
||||
$html.addClass( minPrefix + minBreakpoints.join(" " + minPrefix) + " " + maxPrefix + maxBreakpoints.join(" " + maxPrefix) );
|
||||
};
|
||||
|
||||
//common breakpoints, overrideable, changeable
|
||||
|
|
|
|||
Loading…
Reference in a new issue