Add to Google

Javascript Back , Forward Or Next Buttons Issue

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > HTML, XML etc..

Javascript Back , Forward Or Next Buttons Issue

kvarnerexpress
Okay webmasters, please put your wizard hats on and work your magic.

I have a great little slide show that I am working on. I just about have
it done, but I have a problem that is driving me nuts!!!

The problem is my "back" button. Once the back button hits the first
image and the user clicks back again, a javascript error occurs (it
states: That my variable is not defined). I know that it is defined
otherwise the back button would not work at all. The "next" button does
not have this problem it will loop continously. I have been researching
others slideshows and a lot of them use seperate html pages or have an
alert appear when the user tries to go past the first image.

Here's the code: Note** imageDB is the array for all the images.

CODE
function next() {
if (boardNum < imageDB.length - 1) boardNum++;
else boardNum = 0;
document.selections.cached.selectedIndex = boardNum
document.thumbnail1.src = imageDB[boardNum].src
boardSpeed=6000;
}

function back() {
if (boardNum < imageDB.length - 1) boardNum--;
else boardNum = 0;

document.selections.cached.selectedIndex = boardNum
document.thumbnail1.src = imageDB[boardNum].src
boardSpeed=6000;
}

// This is the function for rotation of images, call for this in the body<tag> onload
function rotateBoard() {
if (boardNum < imageDB.length - 1) boardNum++;

else boardNum = 0;
document.selections.cached.selectedIndex = boardNum
document.thumbnail1.src = imageDB[boardNum].src
setTimeout('rotateBoard()', boardSpeed);
}


My goal is for the back button to jump back on image 1 and go to the
last image and then continue to count down from there.

I have tried using an if statement, it removed the error but the back
button would only go to the first image and that was it.

Also, would you happen to know of a good reliable tool for compiling
javascript in. A watch/debugger utility, where I can run a script and
watch how it plays out with the variables and functions.

I thank you in advance for any help...

 

 

 


Reply

Chameleon
not sure about your problem, but as for a tool to load javascript into Edit Plus seems to work well, text editor that has an output window and debugger

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. button javascript - 3.84 hr back. (1)
  2. javascript automatic back - 28.29 hr back. (1)
  3. php forward button - 82.20 hr back. (1)
  4. back function html - 138.75 hr back. (1)
  5. button back image - 162.72 hr back. (1)
  6. div next forward javascript - 339.31 hr back. (1)
  7. javascript "event.button" back forward - 641.98 hr back. (1)
  8. javascript automatic next back button - 1840.80 hr back. (1)
Similar Topics

Keywords : javascript, back, forward, buttons, issue

  1. Validating Javascript
    at the w3c (2)
  2. Flash Wmode(transparent) Pramater In Firefox3(on Linux) - Not Working
    issue with flash transparancy and firefox3( on linux op. sistem) (2)
    Can anybody help me... Unfortunately I have an issue with firefox2-3 (under linux (ubuntu)
    operating sistem) and flash transparacy... The site structure is: Menu (dropdown with javascript)
    and under that a big flash with wmode=transparent param enabled.. On mouse-over the menu is not
    appearing because the flash hides it... With all other browsers it works. I understood that this
    is a flash plugin bug under linux - firefox2-3 Does anyone has a solution?....
  3. Template Coding Issue
    (7)
    Heyo, I'm coding this template here; http://dailyanimation.info/ , and I need some help. In
    firefox, it looks fine. No problems what-so-ever. Safari, the last nav link appears to be "Home"
    instead of "Music" which is fixable, I think I might has mistyped the css. But then in IE everything
    is choppy. The entire page is missaligned, the nav all appears to be "home", and is looks horrible.
    I'm not sure what I did wrong with the coding. It must be something with the css because it was
    fine till I coded the nav. The style sheet is located here; http://dailyanima....
  4. Create A Xhtml, Css3 Valid Gallery With Javascript ;part 1
    (0)
    What were making In this tutorial, we will be creating a web page that can be used for a gallery, an
    easy way of showing your portfolio of works or photography, etc. The page will be coded in XHTML
    1.0 Strict and CSS3 valid, our CSS won't even have any warnings on them apart from one. So the
    first thing we need to do is set up a base structure for the XHTML. Below is the code for this.
    HTML html xmlns =" http://www.w3.org/1999/xhtml "> head > meta http-equiv =" Content-Type
    " content=" text/html; charset=iso-8859-1 " /> title >XHTML & CSS Gallery /t....
  5. Url Redirection = Javascript+html
    Redirect using scripts! (4)
    In javascript Browser redirection can be done in 3 ways: 1) Alert Redirect: CODE
        alert("This page has been moved to a new location... click OK to be redirected.");     location
    = "http://www.your-website.com"; 2) Confirm and Redirect: CODE
        if(confirm("This page has been moved to a new location... would you like to be redirected"))
        {   location = "http://www.your-website.com";     }     else     {   history.back();     }
    3) Stealth Redirect: CODE     location = "http://www.your-website.com"; ....
  6. Html And Javascript
    Not php as first indicated... (12)
    Edit your ScrollBar colors Change "Your color", to color code, that u need. CODE BODY {
    scrollbar-face-color: Your color; scrollbar-highlight-color: Your color; scrollbar-3dlight-color:
    Your color; scrollbar-darkshadow-color: Your color; scrollbar-shadow-color: Your color;
    scrollbar-arrow-color: Your color; scrollbar-track-color: Your color; } --> Insert Date
    Place this code between , tags CODE var today_date= new Date() var
    month=today_date.getMonth() var today=today_date.getDate() var year=today_date.getYear()" var
    months = new Array(....
  7. Xhtml Strict Method For Submit/reset Buttons As An
    (1)
    What's the proper way to handle submit and reset buttons? Using type submit and reset don't
    allow you to replace the default button with an image, using the type image doesn't allow a
    button to automatically act like a submit or reset....so far as I know. So How should I do this
    when I want to use a custom image as the button? Code will be best way to explain, thanks! ....
  8. Anchor Tag Compliance Issue?
    Firefox is tiny, IE and Opera okay (5)
    I have a string of anchor tags arranged as a menu bar horizontally on a page. Pretty basic stuff is
    included in the css to give some colour and rollover colour change. The page links have been in
    place in the Html code and all are tested and confirmed accurate. This topic has to do with the
    browser only,( I think). I mention this in case there might be concerns about the anchor tags being
    correctly coded. Yes, they are good. So I modified the css to get it looking the way I thought was
    correct for the page in terms of placement, Background colour, rollover effect, etc.....
  9. Substitute Form Button For An Image
    homemade images in forms buttons (3)
    Hi, I have the next formular : CODE                                                  
                                                  I want to substitue the add button for an
    image CODE that i created but i want still to have the same funcitonlity when someone
    clicks. How can i do this? Thanks in advanced!....
  10. Insert Into Database
    Radio Buttons and dropdown menus (8)
    I am currently working on a registration page but I can't figure out a few things, wich all
    basically have the same thing in common Radio Button: In the registration form i have a gender
    selection and I want to input that into the database, I currently have the following: CODE Male
    Female In the registering file I put the following (edited for the question): CODE $SQL =
    "INSERT into go_logintable(gender ) VALUES ('$gender')"; I have no idea if thats the
    right way to go, so please give me some pointers. ____________________________________ D....
  11. Disable Scrollbars, Menubars Etc....
    Javascript / Html code to disable them (6)
    hi, i would like to know how the scrollbars, menubars etc.. can be disabled. I hope someone can help
    me with this. /biggrin.gif" style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif"
    /> Btw: can you tell me where the code should be inserted to? thanks! /cool.gif"
    style="vertical-align:middle" emoid="B)" border="0" alt="cool.gif" />....

    1. Looking for javascript, back, forward, buttons, issue






*SIMILAR VIDEOS*
Searching Video's for javascript, back, forward, buttons, issue

*MORE FROM TRAP17.COM*
advertisement



Javascript Back , Forward Or Next Buttons Issue