#1
  1. No Profile Picture
    Fas
    Guest
    Devshed Newbie (0 - 499 posts)
    I'm having trouble when I want a link in a menu in frame1 to trigger an Image roll-over in another frame.
    In my page, the user can go to the selected item by clicking on it's link in the main menu. After following this link the image in another frame should change, but all that I'm getting is a JScript 'not defined' error. ( I've put all my roll-over images in an array)

    Please give me an example how to make an onclick event that changes an image in another frame.

    Grtz Fas
  2. #2
  3. No Profile Picture
    Bjoern
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi Fas!

    You´ve got to name the picture in frame[2], preload the image you want to insert and then you add the following to your link in frame[1]:

    onClick(or any other event handler)="top.frames[2].document.images.your_image_name.src = second_image_name.src;"

    This is not the best solution though. I´d preffer to make a funktion you can call when clicking on the link. As to the frameset: I think here is your real problem. You´ve got to work out how to reference the image through the frames-tree. Nameing your frames in the frameset might help a bit there.

    Take care
    Bjoern
  4. #3
  5. No Profile Picture
    Fas
    Guest
    Devshed Newbie (0 - 499 posts)
    Thnx Bjoern,

    I'll take a look at it
  6. #4
  7. No Profile Picture
    Fas
    Guest
    Devshed Newbie (0 - 499 posts)
    Again I get an Error when using the above method. As you suggested, Bjoern, I already preloaded all images in the top document (frameset), but for some reason those definitions won't be 'transferred' through the tree.

    The error I get this time, is that the name of the frame I use isn't defined, although the fact that I've named the frame in the frameset??

    In what why can a frame be declared in another frame?

  8. #5
  9. No Profile Picture
    Bjoern
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi again!

    Try numbering the frames instead of using the names. Maybe that works better
    top.frames[number].document.images.src = ..
    if you´ve got more frames and you´re not sure wich is the right number get the location of the frame
    alert(top.frames[number].location);

    hope THIS helps =;D-
    Bjoern
  10. #6
  11. No Profile Picture
    Fas
    Guest
    Devshed Newbie (0 - 499 posts)
    Have it fixed now!
    I had a picture named the same as the frame... not very smart of course but such things can happen...

    thnx anyway Bjoern

    Grtz Fas
  12. #7
  13. No Profile Picture
    mannequin
    Guest
    Devshed Newbie (0 - 499 posts)
    Fas, do you have a link to your webpage where this is incorporated because it's a script I am also interested in.

    Thank you,

    William

Similar Threads

  1. WHM account creation error messages on RH
    By borisbaloney in forum Linux Help
    Replies: 0
    Last Post: December 16th, 2003, 06:54 PM
  2. Replies: 1
    Last Post: October 19th, 2003, 11:15 AM
  3. changing two images sequentially?
    By nat_walker68 in forum HTML Programming
    Replies: 0
    Last Post: September 2nd, 2003, 09:44 AM
  4. changing images
    By Joshua_Hesketh in forum HTML Programming
    Replies: 10
    Last Post: July 24th, 2003, 10:08 AM
  5. javascript images frames
    By halflypye in forum JavaScript Development
    Replies: 1
    Last Post: July 19th, 2003, 11:16 PM

IMN logo majestic logo threadwatch logo seochat tools logo