File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 554554 thumbObj . src = thumb . src ;
555555 }
556556
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+
557566 function onMousemove ( e ) {
558567 pos . x = e . clientX ;
559568 pos . y = e . clientY ;
564573 isOverThumb = inBounds ;
565574 }
566575
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 ) ;
571578 move ( ) ;
572- } else {
573- onThumbLeave ( ) ;
574- isOverThumb = false ;
575- $magnifierPreview . addClass ( MagnifyCls . magnifyHidden ) ;
576579 }
577580 }
578581
589592 } ) ;
590593
591594 $box . on ( 'mousemove' , onMousemove ) ;
595+ $box . on ( 'mouseleave' , onMouseLeave ) ;
596+
592597 _init ( $box , customUserOptions ) ;
593598 }
594599} ( jQuery ) ) ;
You can’t perform that action at this time.
0 commit comments