jQuery(function($){ 'use strict'; // ------------------------------------------------------------- // Centered Navigation // ------------------------------------------------------------- (function () { var $frame = $('#centered'); var $wrap = $frame.parent(); // Call Sly on frame $frame.sly({ horizontal: 1, itemNav: 'centered', smart: 1, activateOn: 'click', mouseDragging: 1, touchDragging: 1, releaseSwing: 1, startAt: 3, scrollBar: $wrap.find('.scrollbar'), scrollBy: 1, speed: 300, elasticBounds: 1, easing: 'easeOutExpo', dragHandle: 1, dynamicHandle: 1, clickBar: 1, // Buttons prev: $wrap.find('.prev'), next: $wrap.find('.next') }); // To Start button $wrap.find('.toStart').on('click', function () { var item = $(this).data('item'); // Animate a particular item to the start of the frame. // If no item is provided, the whole content will be animated. $frame.sly('toStart', item); }); // To End button $wrap.find('.toEnd').on('click', function () { var item = $(this).data('item'); // Animate a particular item to the end of the frame. // If no item is provided, the whole content will be animated. $frame.sly('toEnd', item); }); }()); });