提交 | 用户 | 时间
|
58d006
|
1 |
/** |
A |
2 |
<b>Auto Container</b> Adds .container when window size is above 1140px. |
|
3 |
In Bootstrap you should stick with fixed width breakpoints. |
|
4 |
You can use this feature to enable fixed container only when window size is above 1140px |
|
5 |
*/ |
|
6 |
(function($ , undefined) { |
|
7 |
|
|
8 |
$(window).on('resize.auto_container', function() { |
|
9 |
var enable = $(window).width() > 1140; |
|
10 |
try { |
|
11 |
ace.settings.main_container_fixed(enable, false, false); |
|
12 |
} catch(e) { |
|
13 |
if(enable) $('.main-container,.navbar-container').addClass('container'); |
|
14 |
else $('.main-container,.navbar-container').removeClass('container'); |
|
15 |
$(document).trigger('settings.ace', ['main_container_fixed' , enable]); |
|
16 |
} |
|
17 |
}).triggerHandler('resize.auto_container'); |
|
18 |
|
|
19 |
})(window.jQuery); |