Adds the image size to gallery nav (waiting the image load) (#31407)
* adds the image size to gallery nav * replaces tabs with spaces Co-authored-by: Erik Golinelli <erik@codekraft.it>
This commit is contained in:
parent
fedb5e9677
commit
7f86a45292
|
@ -242,8 +242,15 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
item = $( '<a></a>' ).attr( 'href', '#' ).text( j );
|
item = $( '<a></a>' ).attr( 'href', '#' ).text( j );
|
||||||
if ( slider.vars.controlNav === "thumbnails" ) {
|
if (slider.vars.controlNav === "thumbnails") {
|
||||||
item = $( '<img/>' ).attr( 'src', slide.attr( 'data-thumb' ) );
|
item = $('<img/>', {
|
||||||
|
load: function (el) {
|
||||||
|
el.currentTarget.width = el.currentTarget.naturalWidth;
|
||||||
|
el.currentTarget.height = el.currentTarget.naturalHeight;
|
||||||
|
},
|
||||||
|
src: slide.attr('data-thumb'),
|
||||||
|
alt: slide.attr('alt')
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( '' !== slide.attr( 'data-thumb-alt' ) ) {
|
if ( '' !== slide.attr( 'data-thumb-alt' ) ) {
|
||||||
|
|
Loading…
Reference in New Issue