File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change 11/*!
2- * jQuery Magnify Plugin v1.6.16 by T. H. Doan (http://thdoan.github.io/magnify/)
2+ * jQuery Magnify Plugin v1.6.17 by T. H. Doan (http://thdoan.github.io/magnify/)
33 * Based on http://thecodeplayer.com/walkthrough/magnifying-glass-for-images-using-jquery-and-css3
44 *
55 * jQuery Magnify by T. H. Doan is licensed under the MIT License.
233233 this . destroy = function ( ) {
234234 this . each ( function ( ) {
235235 var $this = $ ( this ) ,
236- $magnifyParent = $this . parent ( '.magnify' ) ,
237- sStyle = $this . data ( 'originalStyle' ) ;
238- if ( sStyle ) $this . attr ( 'style' , sStyle ) ;
239- else $this . removeAttr ( 'style' ) ;
240-
241- if ( $magnifyParent . length ) {
242- $magnifyParent . replaceWith ( $this ) ;
243- }
244- $this . prevAll ( '.magnify-lens' ) . remove ( ) ;
236+ $lens = $this . prev ( 'div.magnify-lens' ) ,
237+ sStyle = $this . data ( 'originalStyle' ) ;
238+ if ( $this . parent ( 'div.magnify' ) . length && $lens . length ) {
239+ if ( sStyle ) $this . attr ( 'style' , sStyle ) ;
240+ else $this . removeAttr ( 'style' ) ;
241+ $this . unwrap ( ) ;
242+ $lens . remove ( ) ;
243+ }
245244 } ) ;
246245 // Unregister event handler
247246 $ ( window ) . off ( 'resize' , refresh ) ;
You can’t perform that action at this time.
0 commit comments