@@ -572,13 +572,10 @@ function initScript() {
572572 pageJumpInput . setAttribute ( 'max' , totalPages ) ;
573573 setTimeout ( function ( ) {
574574 hideLoading ( ) ;
575- if ( document . documentElement . mediumZoomInstance ) {
576- document . documentElement . mediumZoomInstance . detach ( ) ;
577- }
578- document . documentElement . mediumZoomInstance = mediumZoom ( '#eb-content img' , {
579- margin : 24 ,
580- background : '#000' ,
581- scrollOffset : 0
575+ Fancybox . bind ( '#eb-content img' , {
576+ Toolbar : {
577+ display : [ 'close' ] ,
578+ } ,
582579 } ) ;
583580 } , 500 ) ;
584581 } , 200 ) ;
@@ -817,7 +814,7 @@ function initScript() {
817814 var tn = t . tagName . toLowerCase ( ) ;
818815 if ( tn === 'a' || tn === 'button' || tn === 'input' || tn === 'textarea' || tn === 'select' || tn === 'img' ) interactive = true ;
819816 else if ( t . closest ( 'a' ) || t . closest ( 'button' ) || t . closest ( 'input' ) || t . closest ( 'textarea' ) || t . closest ( 'select' ) ) interactive = true ;
820- else if ( t . closest ( '.navigation' ) || t . closest ( '.font-controls' ) || t . closest ( '.reading-controls' ) || t . closest ( '.toc-container' ) || t . closest ( '.medium-zoom-container ' ) || t . closest ( '.top-controls' ) || t . closest ( '.mobile-controls' ) ) interactive = true ;
817+ else if ( t . closest ( '.navigation' ) || t . closest ( '.font-controls' ) || t . closest ( '.reading-controls' ) || t . closest ( '.toc-container' ) || t . closest ( '.fancybox__container ' ) || t . closest ( '.top-controls' ) || t . closest ( '.mobile-controls' ) ) interactive = true ;
821818 if ( interactive ) return ;
822819
823820 var w = window . innerWidth ;
@@ -1003,7 +1000,7 @@ function initScript() {
10031000
10041001 document . getElementById ( 'eb-content' ) . addEventListener ( 'click' , function ( e ) {
10051002 var t = e . target ;
1006- var img = t . tagName . toLowerCase ( ) === 'img' || t . closest ( 'img' ) || t . closest ( '.medium-zoom-container ' ) ;
1003+ var img = t . tagName . toLowerCase ( ) === 'img' || t . closest ( 'img' ) || t . closest ( '.fancybox__container ' ) ;
10071004 if ( img ) return ;
10081005 var rect = e . currentTarget . getBoundingClientRect ( ) ;
10091006 var cx = rect . left + rect . width / 2 ;
@@ -1417,14 +1414,13 @@ function initScript() {
14171414 } else {
14181415 mobileControls . style . transform = 'translateY(0)' ;
14191416 }
1420-
1421- if ( document . documentElement . mediumZoomInstance ) {
1422- document . documentElement . mediumZoomInstance . detach ( ) ;
1423- }
1424- document . documentElement . mediumZoomInstance = mediumZoom ( '#eb-content img' , {
1425- margin :24 , background :'#000' , scrollOffset :0
1417+
1418+ Fancybox . bind ( '#eb-content img' , {
1419+ Toolbar : {
1420+ display : [ 'close' ] ,
1421+ } ,
14261422 } ) ;
1427-
1423+
14281424 var fontControlBtn = document . getElementById ( 'fontControlBtn' ) ;
14291425 var mobileFontBtn = document . getElementById ( 'mobileFontBtn' ) ;
14301426 var fontControls = document . getElementById ( 'fontControls' ) ;
0 commit comments