fredhq/roundabout — Issue #13: Mousewheel Support / getChildInFocus
Author: sberger
Created: 2012-02-20 11:33:26+00:00
State: open

Hi,

at the moment I using the mousewheel plugin from brandon aaron.
it is not as smooth as the drag drop extension but with the duration set to low values every fired event will be processed, yay.

the problem is that sometimes getChildInFocus returns false.
usually when the (bearing?) current position is 180° or 0°

can you give me a hint what im doing wrong?

best regards,
simon

the code i use

```javascript
$('.coverflow').bind('mousewheel',function(e,delta,deltaX,deltaY){

var cPos, nextPos;

e.preventDefault();
e.stopPropagation();

cPos = $('.coverflow').roundabout("getChildInFocus");
nextPos = cPos+delta;

if(nextPos > 15 ) nextPos = nextPos-16;
if(nextPos < 0 ) nextPos = nextPos+16;

console.log("d:"+delta+" nextPos:"+nextPos+" cPos:"+cPos +" childCount:" +childCount);
console.log(delta, deltaX, deltaY);

$('.coverflow').roundabout("animateToChild", nextPos, 33);
});

```

how i setup
```javascript
$('.coverflow').roundabout({
childSelector: ".coverflow_element",
startingChild: <%=startingCover%>,
autoplay: true,
autoplayInitialDelay: 2500,
autoplayDuration: 2500,
autoplayPauseOnHover: true,
enableDrag: true,
dropEasing: "swing",
responsive: false,
clickToFocus: true,
tilt: 0.0,
minOpacity: 0.1,
maxOpacity: 1.0,
minScale: 0.1,
maxScale: 1.0,
shape: 'squareshrink',
triggerFocusEvents: true

})
```

there are 16 elements in the flow.

Mousewheel Examples:
http://flowplayer.org/tools/toolbox/mousewheel.html
https://github.com/brandonaaron/jquery-mousewheel