Browse Source

Merge pull request #88 from PeteLuo/master

当表格列数过长时将自动出现滚动条
star7th 9 năm trước cách đây
mục cha
commit
bf398a3fde
2 tập tin đã thay đổi với 21 bổ sung0 xóa
  1. 18 0
      Public/css/showdoc.css
  2. 3 0
      Public/js/page/index.js

+ 18 - 0
Public/css/showdoc.css

@@ -14,4 +14,22 @@
 .btn-primary:hover{
 .btn-primary:hover{
   background-color: #07c !important;
   background-color: #07c !important;
   background-image: linear-gradient(to bottom,#07c,#07c);
   background-image: linear-gradient(to bottom,#07c,#07c);
+}
+
+/*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
+::-webkit-scrollbar
+{
+    width: 7px;
+    height: 10px;
+    background-color: rgba(0, 0, 0, 0.1);
+}
+/*定义滑块 内阴影+圆角*/
+::-webkit-scrollbar-thumb
+{
+    background-color: rgba(0, 0, 0, 0.3);
+    -webkit-border-radius:6px;
+    -moz-border-radius: 6px;
+    -ms-border-radius: 6px;
+    -o-border-radius: 6px;
+    border-radius: 6px;
 }
 }

+ 3 - 0
Public/js/page/index.js

@@ -13,6 +13,9 @@ $(function(){
 
 
     //为所有table标签添加bootstap支持的表格类
     //为所有table标签添加bootstap支持的表格类
     $("table").addClass("table table-bordered table-hover");
     $("table").addClass("table table-bordered table-hover");
+    $.each($('table'), function() {
+        $(this).prop('outerHTML', '<div style="width: 100%;overflow-x: auto;">'+$(this).prop('outerHTML')+'</div>');
+    });
 
 
       //超链接都在新窗口打开
       //超链接都在新窗口打开
     $('a[href^="http"]').each(function() {
     $('a[href^="http"]').each(function() {