This commit is contained in:
shuzheng 2016-12-15 18:08:17 +08:00
parent 994bd23c16
commit 692625ddc3
5 changed files with 16 additions and 9 deletions

View File

@ -112,7 +112,7 @@ a, a:hover, a:active, a:focus {text-decoration: none; -webkit-user-drag: none;}
/* 选项卡 */
.content_tab{width:100%;height:48px;overflow:hidden;}
.content_tab>ul{padding:0;font-size:0;display:block;white-space:nowrap;overflow:auto;}
.content_tab>ul{padding:0;font-size:0;display:block;white-space:nowrap;-webkit-overflow-scrolling:touch;overflow-x:scroll;}
.scroll>ul{margin:0 40px;}
.scroll>.tab_left,.scroll>.tab_right{display:block;}
.tab_left,.tab_right{width:40px;height:48px;line-height:48px;color:#fff;text-align:center;display:none;}
@ -128,7 +128,7 @@ a, a:hover, a:active, a:focus {text-decoration: none; -webkit-user-drag: none;}
.content_tab>ul>li>a:after{content:"";position:absolute;bottom:0;left:50%;right:50%;width:0;border-bottom:3px solid #FFEB3B;transition:all linear .2s}
.content_tab>ul>.cur>a:after{left:0;bottom:1px;width:100%;opacity:1;transition:all linear .2s}
.content_main{height: calc(100% - 48px);}
.content_main{height:calc(100% - 48px);-webkit-overflow-scrolling:touch;overflow-y:scroll;}
.content_main>.cur{display:block;}
.iframe{height:100%;display:none;}

View File

@ -217,6 +217,7 @@
<script src="plugins/waves-0.7.5/waves.min.js"></script>
<script src="plugins/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="plugins/BootstrapMenu.min.js"></script>
<script src="plugins/device.min.js"></script>
<script src="js/admin.js"></script>
</body>

View File

@ -1,16 +1,17 @@
var click = device.mobile() ? 'touchstart' : 'click';
$(function() {
// 侧边栏操作按钮
$('#guide').click(function() {
$(document).on(click, '#guide', function() {
$(this).toggleClass('toggled');
$('#sidebar').toggleClass('toggled');
});
// 侧边栏二级菜单
$('.sub-menu a').click(function() {
$(document).on('click', '.sub-menu a', function() {
$(this).next().slideToggle(200);
$(this).parent().toggleClass('toggled');
});
// 个人资料
$('.s-profile a').click(function() {
$(document).on('click', '.s-profile a', function() {
$(this).next().slideToggle(200);
$(this).parent().toggleClass('toggled');
});
@ -69,13 +70,13 @@ $(function() {
}
});
// 控制选项卡滚动位置
$('.tab_left>a').click(function() {
$(document).on('click', '.tab_left>a', function() {
$('.content_tab>ul').animate({scrollLeft: $('.content_tab>ul').scrollLeft() - 300}, 200, function() {
initScrollState();
});
});
// 向右箭头
$('.tab_right>a').click(function() {
$(document).on('click', '.tab_right>a', function() {
$('.content_tab>ul').animate({scrollLeft: $('.content_tab>ul').scrollLeft() + 300}, 200, function() {
initScrollState();
});
@ -180,15 +181,17 @@ var Tab = {
initScrollState();
});
} else {
$('#tab_' + index).click();
$('#tab_' + index).trigger('click');
}
// 关闭侧边栏
$('#guide').trigger(click);
},
closeTab: function($item) {
var closeable = $item.data('closeable');
if (closeable != false) {
// 如果当前时激活状态则关闭后激活左边选项卡
if($item.hasClass('cur')) {
$item.prev().click();
$item.prev().trigger('click');
}
// 关闭当前选项卡
var index = $item.data('index');

View File

@ -0,0 +1,2 @@
/*! device.js 0.2.7 */
(function(){var a,b,c,d,e,f,g,h,i,j;b=window.device,a={},window.device=a,d=window.document.documentElement,j=window.navigator.userAgent.toLowerCase(),a.ios=function(){return a.iphone()||a.ipod()||a.ipad()},a.iphone=function(){return!a.windows()&&e("iphone")},a.ipod=function(){return e("ipod")},a.ipad=function(){return e("ipad")},a.android=function(){return!a.windows()&&e("android")},a.androidPhone=function(){return a.android()&&e("mobile")},a.androidTablet=function(){return a.android()&&!e("mobile")},a.blackberry=function(){return e("blackberry")||e("bb10")||e("rim")},a.blackberryPhone=function(){return a.blackberry()&&!e("tablet")},a.blackberryTablet=function(){return a.blackberry()&&e("tablet")},a.windows=function(){return e("windows")},a.windowsPhone=function(){return a.windows()&&e("phone")},a.windowsTablet=function(){return a.windows()&&e("touch")&&!a.windowsPhone()},a.fxos=function(){return(e("(mobile;")||e("(tablet;"))&&e("; rv:")},a.fxosPhone=function(){return a.fxos()&&e("mobile")},a.fxosTablet=function(){return a.fxos()&&e("tablet")},a.meego=function(){return e("meego")},a.cordova=function(){return window.cordova&&"file:"===location.protocol},a.nodeWebkit=function(){return"object"==typeof window.process},a.mobile=function(){return a.androidPhone()||a.iphone()||a.ipod()||a.windowsPhone()||a.blackberryPhone()||a.fxosPhone()||a.meego()},a.tablet=function(){return a.ipad()||a.androidTablet()||a.blackberryTablet()||a.windowsTablet()||a.fxosTablet()},a.desktop=function(){return!a.tablet()&&!a.mobile()},a.television=function(){var a;for(television=["googletv","viera","smarttv","internet.tv","netcast","nettv","appletv","boxee","kylo","roku","dlnadoc","roku","pov_tv","hbbtv","ce-html"],a=0;a<television.length;){if(e(television[a]))return!0;a++}return!1},a.portrait=function(){return window.innerHeight/window.innerWidth>1},a.landscape=function(){return window.innerHeight/window.innerWidth<1},a.noConflict=function(){return window.device=b,this},e=function(a){return-1!==j.indexOf(a)},g=function(a){var b;return b=new RegExp(a,"i"),d.className.match(b)},c=function(a){var b=null;g(a)||(b=d.className.replace(/^\s+|\s+$/g,""),d.className=b+" "+a)},i=function(a){g(a)&&(d.className=d.className.replace(" "+a,""))},a.ios()?a.ipad()?c("ios ipad tablet"):a.iphone()?c("ios iphone mobile"):a.ipod()&&c("ios ipod mobile"):a.android()?c(a.androidTablet()?"android tablet":"android mobile"):a.blackberry()?c(a.blackberryTablet()?"blackberry tablet":"blackberry mobile"):a.windows()?c(a.windowsTablet()?"windows tablet":a.windowsPhone()?"windows mobile":"desktop"):a.fxos()?c(a.fxosTablet()?"fxos tablet":"fxos mobile"):a.meego()?c("meego mobile"):a.nodeWebkit()?c("node-webkit"):a.television()?c("television"):a.desktop()&&c("desktop"),a.cordova()&&c("cordova"),f=function(){a.landscape()?(i("portrait"),c("landscape")):(i("landscape"),c("portrait"))},h=Object.prototype.hasOwnProperty.call(window,"onorientationchange")?"orientationchange":"resize",window.addEventListener?window.addEventListener(h,f,!1):window.attachEvent?window.attachEvent(h,f):window[h]=f,f(),"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return a}):"undefined"!=typeof module&&module.exports?module.exports=a:window.device=a}).call(this);

File diff suppressed because one or more lines are too long