»
EnglishFrenchVietnamese

Print - Slideshow by keyboard - JavaScriptBank.com

Full version: jsB@nk » Image » Slideshow by keyboard
URL: https://www.javascriptbank.com/image-animation-by-keyboard.html

Slideshow by keyboard © JavaScriptBank.comWhy using fat Gif-Animations if you can surprise your visitors with smart DHTML-driven image-effects? This JavaScripts lets you steer and move your images by keyboard.

Full version: jsB@nk » Image » Slideshow by keyboard
URL: https://www.javascriptbank.com/image-animation-by-keyboard.html



JavaScript
<script language="Javascript" type="text/javascript"><!-- Hide script from old browsersmyPix = new Array("pic191.jpg","logojs.gif","photo1.jpg","photo2.jpg","photo3.jpg","photo4.jpg","photo5.jpg","photo6.jpg","photo7.jpg")thisPic = 0imgCt = myPix.length - 1document.onkeydown = keyHitif (document.layers) {document.captureEvents(Event.KEYDOWN)ltArrow = 28rtArrow = 29}else {ltArrow = 37rtArrow = 39}function keyHit(evt) {if (evt) {thisKey = evt.which}else {thisKey = window.event.keyCode}if (thisKey == ltArrow) {chgSlide(-1)}else if (thisKey == rtArrow) {chgSlide(1)}}function chgSlide(direction) {if (document.images) {thisPic = thisPic + directionif (thisPic > imgCt) {thisPic = 0}if (thisPic < 0) {thisPic = imgCt}document.myPicture.src=myPix[thisPic]}}// End hiding script from old browsers --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<b>Use the right and left arrows on your keyboard to view the slideshow</b><br><img src="pic191.jpg" name="myPicture" alt="Slideshow"><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->