Closed lilyjiang closed 8 years ago
could you just add another config option 'img_attr' and then i can use .zoom({img_attr: data-img}) or whatever i need?
related: use of data('src') is not ideal as it reads the initial value of data-src. its preferrable to look in attr('data-src') directly.
@lilyjiang My apologies for overlooking this, that sounds like a fine suggestion. I hope you were able to get this to work by using the url
option, no need to depend on zoom's defaults.
Since I used Breakpoints and Picture modules to make the images responsive in a drupal site, the structure will be like the: img srcset="http://drupal7.com/sites/default/files//public/IMG_2785.jpg 2592w" alt="" title=""
then it can't work on it, because the code is: settings.url = $urlElement.data('src') || $urlElement.attr('src');
I suggest it be: settings.url = $urlElement.data('src') || $urlElement.attr('src') || $urlElement[0].currentSrc;