elevatezoom icon indicating copy to clipboard operation
elevatezoom copied to clipboard

undefined self.zoomWrap

Open ghost opened this issue 9 years ago • 0 comments

In some cases elevatezoom produces self.zoomWrap undefined errors.

If self.options.imageCrossfade is enabled, then line 130 defines self.zoomWrap. But there are cases when elevatezoom doesn't properly check if self.options.imageCrossfade is enabled, and still tries to access this variable.

For example, when loading elevatezoom with:

elevateZoom({ constrainType: 'width', zoomType: 'inner', imageCrossfade: false, //other options removed... });

then lines 1362 and 1363 try to access an undefined variable. This also happens when constrainType is set to height, but on different lines of code.

The solution is to add more checks, for example with: if(self.options.imageCrossfade){

Thank you.

ghost avatar Aug 15 '15 06:08 ghost