Roundabout プラグイン ( http://fredhq.com/projects/roundabout ) を使用していますが、左/右矢印キーを押して次/前にアニメーション化するなど、プリセットの呼び出し可能なメソッドを使用する方法がわかりません。
これらのプリセットを使用せずにキープレスを一般的に機能させることはできますが、実際にはさまざまなキープレスでプリセット クラスを使用したいと考えています。何か案は?
HTML
<div id="carousel-container">
<ul class="roundabout-holder">
<li class="roundabout-moveable-item roundabout-in-focus"></li>
<li class="roundabout-moveable-item"></li>
<li class="roundabout-moveable-item"></li>
<li class="roundabout-moveable-item"></li>
<li class="roundabout-moveable-item"></li>
</ul>
</div>
jQueryのセットアップ
<script> // Calling the Roundabout plugin
$(document).ready(function() {
$('ul').roundabout();
});
</script>
$(document.documentElement).keyup(function (event) {
var direction = null;
// handle cursor keys
if (event.keyCode == 37) {
// go left
$('#roundabout-container').roundabout("animateToNextChild");
} else if (event.keyCode == 39) {
// go right
$('#roundabout-container').roundabout("animateToPreviousChild");
}
if (direction != null) {
$('ul.roundabout-holder li.roundabout-moveable-item').parent()[direction]().find('a').click();
}
});