#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    6
    Rep Power
    0
    I got a problem: 3 frames (left, center, right). The LEFT contains the navigation bar made of 6 roll-over buttons (made with GoLive). Now, when I click on one, I change the content of CENTER, but I'd also like that the pressed button remains in its last state. How do I achieve this??? I tried with document.images[1].src="image.gif", but nothing worked...
    HELP ME!!!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    114
    Rep Power
    15
    What you seek can be done. It helps if you use an alphanumeric identifier for your left frame pictures, but you can also load the values into an array:

    var leftImages = new Array
    leftImages[0]="image1"
    leftImages[1]="image2"
    .
    .
    .
    leftImages[n]="image" + n //if you use a similar naming convention you could use a loop to declare the values of the array.

    then you need some code that will preserve the state of the button you've clicked and return all the others to their original state.

    function Call_This_at_OnClick(button){
    var been_clicked = button
    for(i=0;i<n;i++){
    if (leftImage[i]!=button){
    document.all[leftImage[i]].src='original_state.gif'
    }
    }
    }

    That's essentially it, though the above code is only a rough outline and I can't guarantee that it won't need some tweeking. But basically, you just have to set up some way that will reset all the images except the one you clicked on. Hope that helps.



    [This message has been edited by billyo (edited July 02, 2000).]

Similar Threads

  1. Finding Images in HTML
    By beardo in forum PHP Development
    Replies: 14
    Last Post: March 28th, 2004, 06:29 AM
  2. Replies: 2
    Last Post: December 20th, 2003, 11:56 AM
  3. WHM account creation error messages on RH
    By borisbaloney in forum Linux Help
    Replies: 0
    Last Post: December 16th, 2003, 06:54 PM
  4. Javascript image preload race condition
    By lmcccha in forum JavaScript Development
    Replies: 5
    Last Post: February 13th, 2003, 08:21 PM
  5. Replies: 0
    Last Post: February 28th, 2002, 03:12 PM

IMN logo majestic logo threadwatch logo seochat tools logo