@@ -208,27 +208,19 @@ window._component = {
208
208
dom . onload = function ( ) {
209
209
if ( ! zoom ) return ;
210
210
let img = document . createElement ( 'img' ) ;
211
- dom . setAttribute ( 'data-zoom' , '0' ) ;
212
211
dom . addEventListener ( 'mouseover' , function ( e ) {
213
- if ( dom . getAttribute ( 'data-zoom' ) === '1' ) return ;
214
- setTimeout ( ( ) => {
215
- dom . setAttribute ( 'data-zoom' , '1' ) ;
216
212
document . body . append ( img ) ;
217
213
img . style . position = 'absolute' ;
218
- img . style . top = `${ e . pageY - 3 } px` ;
219
- img . style . left = `${ e . pageX - 3 } px` ;
214
+ img . style . top = `${ e . pageY + 7 } px` ;
215
+ img . style . left = `${ e . pageX + 7 } px` ;
220
216
img . style . zIndex = '1000000' ;
221
217
img . style . width = '300px' ;
222
218
img . style . borderRadius = '3px' ;
223
219
img . setAttribute ( 'src' , src ) ;
224
- } , 100 ) ;
225
220
} ) ;
226
221
dom . addEventListener ( 'mouseout' , function ( e ) {
227
222
e . stopPropagation ( ) ;
228
- setTimeout ( ( ) => {
229
- dom . setAttribute ( 'data-zoom' , '0' ) ;
230
223
img . remove ( ) ;
231
- } , 100 ) ;
232
224
} ) ;
233
225
} ;
234
226
} , i * time ) ;
@@ -1078,25 +1070,18 @@ window.ComponentLine = class {
1078
1070
let img = document . createElement ( 'img' ) ;
1079
1071
dom . setAttribute ( 'data-zoom' , '0' ) ;
1080
1072
dom . addEventListener ( 'mouseover' , function ( e ) {
1081
- if ( dom . getAttribute ( 'data-zoom' ) === '1' ) return ;
1082
- setTimeout ( ( ) => {
1083
- dom . setAttribute ( 'data-zoom' , '1' ) ;
1084
- document . body . append ( img ) ;
1085
- img . style . position = 'absolute' ;
1086
- img . style . top = `${ e . pageY - 3 } px` ;
1087
- img . style . left = `${ e . pageX - 3 } px` ;
1088
- img . style . zIndex = '1000000' ;
1089
- img . style . width = '300px' ;
1090
- img . style . borderRadius = '3px' ;
1091
- img . setAttribute ( 'src' , src ) ;
1092
- } , 100 ) ;
1073
+ document . body . append ( img ) ;
1074
+ img . style . position = 'absolute' ;
1075
+ img . style . top = `${ e . pageY + 7 } px` ;
1076
+ img . style . left = `${ e . pageX + 7 } px` ;
1077
+ img . style . zIndex = '1000000' ;
1078
+ img . style . width = '300px' ;
1079
+ img . style . borderRadius = '3px' ;
1080
+ img . setAttribute ( 'src' , src ) ;
1093
1081
} ) ;
1094
1082
dom . addEventListener ( 'mouseout' , function ( e ) {
1095
1083
e . stopPropagation ( ) ;
1096
- setTimeout ( ( ) => {
1097
- dom . setAttribute ( 'data-zoom' , '0' ) ;
1098
- img . remove ( ) ;
1099
- } , 100 ) ;
1084
+ img . remove ( ) ;
1100
1085
} ) ;
1101
1086
} , 200 ) ;
1102
1087
}
0 commit comments