kthornbloom / Smoothproducts

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

Multiple copies of images when page updated by ajax #5

Closed lanceh1412 closed 9 years ago

lanceh1412 commented 10 years ago

Great plugin by the way.

I don't know if it's a problem with the way I've implemented this or what but I'm using this on a page which gets updated with a call to ajax. This triggers the jquery to re-execute and the css is replicated. I've managed to get round this by adding var slideTiming = 300 if ($('.sp-large').length == 0) { // your code in here } so that the code only gets executed if it hasn't already been. I'm sure there must be a better way to do this but I don't really know jQuery!

kthornbloom commented 10 years ago

Thanks for the report. I don't often use AJAX, so I haven't tested it in that regard. I'd be happy to update the plugin to be more stable for you if I can figure out the best way to do that. Is there any way for you to replicate the problem in a testing environment on jsfiddle.net or something similar?

lanceh1412 commented 10 years ago

I've not used jsfiddle.net before but I'll have a go and see if I can replicate it there.