View Full Version : Swap image to another frame

10-14-2008, 07:18 PM
I did a search and couldnt find anything within the first few pages.

What i want to do it have a nav with a simple 2image rollover (easy) but then as i roll over the nav i want an image to pop up in another frameset i.e main content. Then roll to another nav button and the image change again.

All the while allowing once the nav is pressed to go to another page which will target to framest maincontent.

does anyone have any info on this PLEASE?

link im working on. mmgrates.isoars.com (http://mmgrates.isoars.com)

is made up of 4 different framesets.

10-15-2008, 06:02 AM
http://developer.mozilla.org/en/DOM/window.parent http://msdn.microsoft.com/en-us/library/ms534326(VS.85).aspx
http://developer.mozilla.org/en/DOM/window.top http://msdn.microsoft.com/en-us/library/ms534687(VS.85).aspx

Without a framed page's permission, you can only access the frame - not the page itself. Therefore...

in main_content.html:
window.parent.main = window;

function swap(img){ // or whatever you want to call it
// Do your thing here.

in left_nav.html:
window.onload = function(){
var images = document.getElementsByName('nav');
for(var i = 0; i < images.length; i++){
images[i].onmouseover = mouseover;
function mouseover(){
window.parent.main.swap(this); // or whatever you call it