|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
Thnx Bjoern,
I'll take a look at it |
|
#4
|
|||
|
|||
|
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? |
|
#5
|
|||
|
|||
|
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 |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Changing images in other frames |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|