kthornbloom / Smoothproducts

A simple, lightweight and responsive product image viewer using jQuery
kthornbloom.com/smoothproducts
185 stars 89 forks source link

Added a function to clean event listeners of the plugin for single-page websites #42

Closed rzust closed 6 years ago

rzust commented 6 years ago

I got an unexpected behavior using the plugin in an AngularJS website. The plugin would work perfectly the first time after a refresh, but if I continued browsing through the products the .sp-wrap content would flicker like trying to load the image twice.

Added a function to clean the plugin's event listeners to prevent that behavior.

kthornbloom commented 6 years ago

Thanks, @rzust!