Changing iframe content on img rollover

I

info

Hello,

I'm using a simple JavaScript to change a display of images on
rollover, like a script you'd use for navbar buttons, but 6 images at
once. It works fine.

Now I'd like to add code to change some text on the page, as well. I've
placed the text in a series of external html files, and have been
trying to load them using a variety of combinations of .src, .location.
location.href etc. as you'll see in the code below. Haven't been able
to find the right syntax.

I can change the content in the iframe on click, but we'd like it to
change when the images change - on rollover.

Is there a way to change the contents of the iFrame on rollover rather
than on click? Or is there a better strategy than using an iframe.

Code snippet below, including commented out attempts that didn't work.

Thanks in advance,


both "name" and "id" are set to "detailsFrame" in the iframe tag.

function pixAct(pixName){
document["pix1"].src = pix1off.src;
document["pix2"].src = pix2off.src;
document["pix3"].src = pix3off.src;
document["pix4"].src = pix4off.src;
document["pix5"].src = pix5off.src;
document["pix6"].src = pix6off.src;
document[pixName].src = eval(pixName + "on.src");

//document.frame["detailsFrame"].src = "credits01.htm";
//document."detailsFrame".location = "credits01.htm";
//document.frame["detailsFrame"].location = "credits01.htm";
//document."detailsFrame".location.href = "credits01.htm";
//document.["detailsFrame"].src = "images/credits/Tree_tint.jpg";
//document.["detailsFrame"].src = "credits01.htm";
//document.["detailsFrame"].write() = "Please work";
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,817
Latest member
AdalbertoT

Latest Threads

Top