PDA

View Full Version : Add prev and next button to Roundabout for JQuery



ciberkarlos
02-27-2012, 02:19 PM
Hi everyone,

im using the roundabout plugin in my website, and i want to know how to add a button to move from one image to another (like a slideshow) instead of clicking on the image.

Ive tried changing the btnNext and btnPrev but nothing happens, maybe im giving them wrong values.

Thank you very much.


(function($) {
"use strict";

var defaults, internalData, methods;

// add default shape
$.extend({
roundaboutShapes: {
def: "lazySusan",
lazySusan: function (r, a, t) {
return {
x: Math.sin(r + a),
y: (Math.sin(r + 3*Math.PI/2 + a) / 8) * t,
z: (Math.cos(r + a) + 1) / 2,
scale: (Math.sin(r + Math.PI/2 + a) / 2) + 0.5
};
}
}
});

defaults = {
bearing: 0.0,
tilt: 0.0,
minZ: 100,
maxZ: 280,
minOpacity: 0.4,
maxOpacity: 1.0,
minScale: 0.4,
maxScale: 1.0,
duration: 600,
btnNext: null,
btnNextCallback: function() {},
btnPrev: null,
btnPrevCallback: function() {},
btnToggleAutoplay: null,
btnStartAutoplay: null,
btnStopAutoplay: null,
easing: "swing",
clickToFocus: true,
clickToFocusCallback: function() {},
focusBearing: 0.0,
shape: "lazySusan",
debug: false,
childSelector: "li",
startingChild: null,
reflect: false,
floatComparisonThreshold: 0.001,
autoplay: true,
autoplayDuration: 5000,
autoplayPauseOnHover: true,
autoplayCallback: function() {},
autoplayInitialDelay: 0,
enableDrag: true,
dropDuration: 600,
dropEasing: "swing",
dropAnimateTo: "nearest",
dropCallback: function() {},
dragAxis: "x",
dragFactor: 4,
triggerFocusEvents: true,
triggerBlurEvents: true,
responsive: false
};

internalData = {
autoplayInterval: null,
autoplayIsRunning: false,
autoplayStartTimeout: null,
animating: false,
childInFocus: -1,
touchMoveStartPosition: null,
stopAnimation: false,
lastAnimationStep: false
};