Reveal.js左右箭头应该导航宽度键盘并保持ID旁边的ID

时间:2013-10-18 13:22:32

标签: jquery reveal.js

我的DEMO显示导航箭头在点击时正确导航,但也使用(键盘)光标。

  • LEFT和RIGHT需要在其旁边显示部分ID的名称!
  • 单击箭头
  • 不适用于键盘(e.keyCode == 37)(e.keyCode == 39)

Reveal.js

  • 此外,我想在左右箭头上添加ID。

    $('.navigate-right').html('<h3> '+ $(this).text(prevId) +' </h3>');

http://jsfiddle.net/3fJqZ/100/

1 个答案:

答案 0 :(得分:1)

您可以使用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/