We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a50950d + 86abe10 commit f61e5acCopy full SHA for f61e5ac
dist/js/jquery.magnify.js
@@ -233,10 +233,15 @@
233
this.destroy = function() {
234
this.each(function() {
235
var $this = $(this),
236
- sStyle = $this.data('originalStyle');
+ $magnifyParent = $this.parent('.magnify'),
237
+ sStyle = $this.data('originalStyle');
238
if (sStyle) $this.attr('style', sStyle);
239
else $this.removeAttr('style');
- $this.unwrap('.magnify').prevAll('.magnify-lens').remove();
240
+
241
+ if($magnifyParent.length) {
242
+ $magnifyParent.replaceWith($this);
243
+ }
244
+ $this.prevAll('.magnify-lens').remove();
245
});
246
// Unregister event handler
247
$(window).off('resize', refresh);
0 commit comments