Update jquery zoom to grab alt from source image
This commit is contained in:
parent
c9e327809a
commit
c0fe1e25de
|
@ -100,6 +100,7 @@
|
|||
var srcElement = source.querySelector('img');
|
||||
if (srcElement) {
|
||||
settings.url = srcElement.getAttribute('data-src') || srcElement.currentSrc || srcElement.src;
|
||||
settings.alt = srcElement.getAttribute('data-alt') || srcElement.alt;
|
||||
}
|
||||
if (!settings.url) {
|
||||
return;
|
||||
|
@ -227,7 +228,7 @@
|
|||
};
|
||||
|
||||
img.setAttribute('role', 'presentation');
|
||||
img.alt = '';
|
||||
img.alt = settings.alt || '';
|
||||
img.src = settings.url;
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue