File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 554
554
thumbObj . src = thumb . src ;
555
555
}
556
556
557
+ /**
558
+ * Hide magnifier when mouse exceeds image bounds.
559
+ */
560
+ function onMouseLeave ( ) {
561
+ onThumbLeave ( ) ;
562
+ isOverThumb = false ;
563
+ $magnifierPreview . addClass ( MagnifyCls . magnifyHidden ) ;
564
+ }
565
+
557
566
function onMousemove ( e ) {
558
567
pos . x = e . clientX ;
559
568
pos . y = e . clientY ;
564
573
isOverThumb = inBounds ;
565
574
}
566
575
567
- if ( inBounds && isOverThumb ) {
568
- if ( gMode === 'outside' ) {
569
- $magnifierPreview . removeClass ( MagnifyCls . magnifyHidden ) ;
570
- }
576
+ if ( inBounds && isOverThumb && gMode === 'outside' ) {
577
+ $magnifierPreview . removeClass ( MagnifyCls . magnifyHidden ) ;
571
578
move ( ) ;
572
- } else {
573
- onThumbLeave ( ) ;
574
- isOverThumb = false ;
575
- $magnifierPreview . addClass ( MagnifyCls . magnifyHidden ) ;
576
579
}
577
580
}
578
581
589
592
} ) ;
590
593
591
594
$box . on ( 'mousemove' , onMousemove ) ;
595
+ $box . on ( 'mouseleave' , onMouseLeave ) ;
596
+
592
597
_init ( $box , customUserOptions ) ;
593
598
}
594
599
} ( jQuery ) ) ;
You can’t perform that action at this time.
0 commit comments