diff --git a/src/galleria.js b/src/galleria.js index 3df622f4..1e097713 100644 --- a/src/galleria.js +++ b/src/galleria.js @@ -1400,7 +1400,7 @@ Galleria = function() { carousel.loadThumbsOnDemand(function() { for ( i = carousel.current; i < carousel.hooks.length; i++ ) { if ( carousel.hooks[i] - carousel.hooks[ carousel.current ] > carousel.width ) { - carousel.set(i - 2); + carousel.set(Math.max(i-2,carousel.current+1)); break; } } @@ -1417,7 +1417,7 @@ Galleria = function() { carousel.loadThumbsOnDemand(function() { for ( i = carousel.current; i >= 0; i-- ) { if ( carousel.hooks[ carousel.current ] - carousel.hooks[i] > carousel.width ) { - carousel.set( i + 2 ); + carousel.set(Math.min(i+2,carousel.current-1)); break; } else if ( i === 0 ) { carousel.set( 0 ); diff --git a/src/themes/classic/classic-demo.html b/src/themes/classic/classic-demo.html index 467217d9..0d57190a 100644 --- a/src/themes/classic/classic-demo.html +++ b/src/themes/classic/classic-demo.html @@ -8,7 +8,6 @@ /* Demo styles */ html,body{background:#222;margin:0;} body{border-top:4px solid #000;} - .content{color:#777;font:12px/1.4 "helvetica neue",arial,sans-serif;width:620px;margin:20px auto;} h1{font-size:12px;font-weight:normal;color:#ddd;margin:0;} p{margin:0 0 20px} a {color:#22BCB9;text-decoration:none;} @@ -34,14 +33,184 @@