Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var arrayImages = new Array('images/naruto shippuuden characters.jpg','images/Yondaime.jpg', 'images/gaara.jpg', 'images/akatsuki.jpg');
- var thisPic = 0;
- var time_is_on
- function initLinks() {
- document.getElementById("nextLink").onclick = processNext;
- document.getElementById("backLink").onclick = processBack;
- document.getElementById("playLink").onclick = processPlay;
- }
- function processNext() {
- thisPic++;
- if (thisPic == arrayImages.length) {
- thisPic = 0;
- }
- document.getElementById("myPicture").src = arrayImages[thisPic];
- return false;
- }
- function processBack() {
- thisPic--;
- if (thisPic <=-1) {
- thisPic = arrayImages.length-1;
- }
- document.getElementById("myPicture").src = arrayImages[thisPic];
- return false;
- }
- function processPlay() {
- if (!time_is_on) {
- timer_is_on=1;
- goNext();
- }
- return false;
- }
- function goNext() {
- processNext();
- t=setTimeout("goNext()", 2000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement