We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 862b2b7 commit 8d038e3Copy full SHA for 8d038e3
1 file changed
src/baguetteBox.js
@@ -307,6 +307,12 @@
307
case 27: // Esc
308
hideOverlay();
309
break;
310
+ case 36: // Home
311
+ showFirstImage(event);
312
+ break;
313
+ case 35: // End
314
+ showLastImage(event);
315
316
}
317
318
@@ -598,6 +604,22 @@
598
604
return show(currentIndex - 1);
599
605
600
606
607
+ // Return false at the left end of the gallery
608
+ function showFirstImage(event) {
609
+ if (event) {
610
+ event.preventDefault();
611
+ }
612
+ return show(0);
613
614
+
615
+ // Return false at the right end of the gallery
616
+ function showLastImage(event) {
617
618
619
620
+ return show(currentGallery.length - 1);
621
622
601
623
/**
602
624
* Move the gallery to a specific index
603
625
* @param `index` {number} - the position of the image
0 commit comments