diff --git a/src/galleria.js b/src/galleria.js index a29a51c1..cbaffbf9 100644 --- a/src/galleria.js +++ b/src/galleria.js @@ -5090,7 +5090,7 @@ this.prependChild( 'info', 'myElement' ); type: Galleria.IMAGE, index: queue.index, imageTarget: next.image, - thumbTarget: thumb.image, + thumbTarget: thumb ? thumb.image : null, galleriaData: data }); @@ -5122,10 +5122,12 @@ this.prependChild( 'info', 'myElement' ); next.isIframe = data.iframe && !data.image; // add active classes - $( self._thumbnails[ queue.index ].container ) + if ( self._thumbnails[ queue.index ] ) { + $( self._thumbnails[ queue.index ].container ) .addClass( 'active' ) .siblings( '.active' ) .removeClass( 'active' ); + } // trigger the LOADSTART event self.trigger( { @@ -5134,7 +5136,7 @@ this.prependChild( 'info', 'myElement' ); index: queue.index, rewind: queue.rewind, imageTarget: next.image, - thumbTarget: thumb.image, + thumbTarget: thumb ? thumb.image : null, galleriaData: data });