File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -893,6 +893,8 @@ body {
893893
894894/* CSS Column 分页样式 - 使用 CSS Column 实现分页 */
895895.pagination-mode # eb-content {
896+ /* 上面不影响进度条 */
897+ margin-top : 20px !important ;
896898 height : 100% ;
897899 padding : 0px !important ;
898900 margin : 0 ;
Original file line number Diff line number Diff line change @@ -584,6 +584,20 @@ function initScript() {
584584 // 保存原始内容
585585 const originalContent = preprocessContent ( content ) ;
586586
587+ // 获取容器高度
588+ const bottomNav = document . querySelector ( '.navigation' ) ;
589+ const bottomNavMobile = document . querySelector ( '.mobile-controls' ) ;
590+ const bottomNavHeight = getElementHeight ( bottomNav ) ;
591+ const bottomNavMobileHeight = getElementHeight ( bottomNavMobile ) ;
592+
593+ const viewportHeight = window . innerHeight ;
594+
595+ let contentHeight = viewportHeight - bottomNavHeight - bottomNavMobileHeight - 40 ; // 减去边距和安全余量,安全余量就是 margin-top: 20px,然后上下不就都是 20 了
596+ contentContainer . style . height = `${ viewportHeight - bottomNavHeight - bottomNavMobileHeight } px` ;
597+
598+ // 直接设置内容容器的高度
599+ content . style . height = `${ contentHeight } px` ;
600+
587601 // 先恢复原始内容,以便计算内容高度
588602 content . innerHTML = originalContent ;
589603
@@ -617,8 +631,8 @@ function initScript() {
617631 setTimeout ( ( ) => {
618632 calculateTotalPages ( ) ;
619633 pageJumpInput . setAttribute ( 'max' , totalPages ) ;
620- } , 200 ) ;
621- } , 200 ) ;
634+ } , 100 ) ;
635+ } , 100 ) ;
622636 }
623637
624638 // 计算总页数
You can’t perform that action at this time.
0 commit comments