Skip to content

Instantly share code, notes, and snippets.

@j-cam
Last active August 29, 2015 14:24
Show Gist options
  • Save j-cam/3cd45a521486ecc22956 to your computer and use it in GitHub Desktop.
Save j-cam/3cd45a521486ecc22956 to your computer and use it in GitHub Desktop.
Script for setting slideshow options and adding arrow key functionality for photo set pages.
<!-- START SLIDE FUNCTIONALITY -->
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="/storage/js/slides.jquery.js"></script>
<script>
$(function () {
$('#slides').slides({
preload: true,
preloadImage: '/storage/js/loading.jpg',
autoHeight: true,
autoHeightSpeed: 350,
generateNextPrev: false,
generatePagination: false,
bigTarget: true,
play: 0,
pause: 3500,
hoverPause: false,
effect: 'fade',
fadeSpeed: 1,
crossfade: true
});
});
$(document).keydown(function (e) {
if (e.keyCode === 37) {
$('a.prev').trigger('click');
} else if (e.keyCode === 39) {
$('a.next').trigger('click');
}
});
</script>
<!-- END SLIDE FUNTIONALITY -->
@j-cam
Copy link
Author

j-cam commented Jul 8, 2015

Instructions

  1. Click the raw button at the top
  2. Copy paste all of the text into the top of each photo set page.

Note: You can include the top and bottom "" and "" comments just for
visual clarity in the markup in case you need to edit them in the future.

Here is the full photo set template for future use: JR Photo Set Template

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment