1

I've looked at the other questions on this topic, and know that I have to do something like this:

I've created buttons:

<button id="next"></button>
<button id="prev"></button>

And then at the bottom of the page, I have this (this was taken from the other question here):

<script src="js/impress.js"></script>
<script>impress().init();</script>

<script>
$("#next").click(function () {
   api.next();
});

$("#prev").click(function () {
   api.prev();
});
</script>

But it isn't working at all; can someone give me a hand with this?

Community
  • 1
  • 1
imcconnell
  • 844
  • 1
  • 6
  • 17

3 Answers3

1

it works, if next-prev are in inside impress div

$('#next').on('click', function(e){
    impress().next();
    e.stopPropagation();
});

$('#prev').on('click', function(e){
    impress().prev();
    e.stopPropagation();
});
arturmoroz
  • 1,897
  • 1
  • 16
  • 13
0

Replace your script this way:

<script>
$("#next").click(function () {
   impress().next();
});

$("#prev").click(function () {
   impress().prev();
});
</script>
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
0

Have you included jQuery? If not, add this too:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
giokokos
  • 602
  • 1
  • 6
  • 20