example.html 1001 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <html>
  2. <body>
  3. <iframe id="reveal" src="../../index.html" style="border: 0;" width="500" height="500"></iframe>
  4. <div>
  5. <input id="back" type="button" value="go back"/>
  6. <input id="ahead" type="button" value="go ahead"/>
  7. <input id="slideto" type="button" value="slideto 2-2"/>
  8. </div>
  9. <script>
  10. (function (){
  11. var back = document.getElementById( 'back' ),
  12. ahead = document.getElementById( 'ahead' ),
  13. slideto = document.getElementById( 'slideto' ),
  14. reveal = window.frames[0];
  15. back.addEventListener( 'click', function () {
  16. reveal.postMessage( JSON.stringify({method: 'prev', args: []}), '*' );
  17. }, false );
  18. ahead.addEventListener( 'click', function (){
  19. reveal.postMessage( JSON.stringify({method: 'next', args: []}), '*' );
  20. }, false );
  21. slideto.addEventListener( 'click', function (){
  22. reveal.postMessage( JSON.stringify({method: 'slide', args: [2,2]}), '*' );
  23. }, false );
  24. }());
  25. </script>
  26. </body>
  27. </html>