我的演示显示导航箭头在单击时正确导航,但也使用(键盘)光标。
- 左边和右边需要有节ID的名称!
- 点击箭头的作品
- 不适用于键盘
(e.keyCode == 37)(e.keyCode == 39)
揭示.js
-
我还想在左右箭头上附加 ID。
$('.navigate-right').html('<h3> '+ $(this).text(prevId) +' </h3>');
http://jsfiddle.net/3fJqZ/100/
您可以使用
slidechanged
事件来获取所需的内容:
Reveal.addEventListener( 'slidechanged', function( event ) {
var currentSection = $('section.present');
var nextId = currentSection.next('section').attr('id');
$('.navigate-left').text($(event.previousSlide).attr('id'));
$('.navigate-right').text(nextId);
} );
在这里工作 Plunkr:http://jsfiddle.net/3fJqZ/109/