bopp
Member
Posts: 13
Registered: 9/9/2005
Member Is Offline
|
| posted on 9/12/2005 at 06:27 PM |
|
|
swapping images in content iframe
I'm trying to have an image in the html content page of the content iframe switch out...I can't figure out how to target it for the switch...the
switch occurs during the mouseover when n_pos hits a defined location in the scroll (center)...the problem seems to be because the content iframe is
nested within the Tscr iframe
I've tried
frames[framename].images[imgName].src
parent.frame0.document.images['khzoff'].src
getElementById and a few others that I forget already...
any ideas as to how to swap the image out?
http://216.147.31.209/test.html
thanks
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 9/13/2005 at 02:04 PM |
|
|
where the switching code is located, (main page, scroll.html, content page, other)?
|
|
|
bopp
Member
Posts: 13
Registered: 9/9/2005
Member Is Offline
|
| posted on 9/13/2005 at 06:40 PM |
|
|
scroll.html
http://khzradio.com/test.html
I should expand a bit about what I'm trying to do...I want the image that is scrolling to switch when it is at the center of the scroll...I was able
to get the content of an item's iframe to reload but then it would reset off the scroll window, so that didn't work...I have a pause at the center
of the scroll and am trying to switch the image at that time...so far I haven't been able to target an image in the item's iframe, which is nested
in the Tscr1 iframe...I thought document.getElementById('Tscr1').document.getElementById('frame0').... would find it but it doesn't (or
document.all[framename] in ie)...I've tried so many ways I probably just need to start over because I don't know where I am anymore...lol...
A secondary question is if I get the Pro version ( which I will if I can figure out how to swap the image), is that version significantly differently
coded than the free version? meaning if we can figure out the swap in the free version will that still work in the pro version? I should just get pro
anyway because the ability to make the items be closer together in the scroll may be something I have to adjust for...
thanks for your help
bopp
|
|
|
bopp
Member
Posts: 13
Registered: 9/9/2005
Member Is Offline
|
| posted on 9/13/2005 at 10:16 PM |
|
|
Hi Rock
I've been dickin around with this and all of a sudden I have it working...looks like document.getElementById('khzoff').src = imgOn;
works...unfortunately I don't know which edit I did that fixed it...lol
I added
khzon = new Image();
khzon.src = "/s0_data/khzradio_on.gif";
khzoff = new Image();
khzoff.src = "/s0_data/khzradio_off.gif";
to the main page (it was just on scroll.html)...maybe that was it...dunno...
also added name and id to the item frames:
strid = "frame" + i;
if (items.file)
document.write("<iframe name=\"" + strid + "\" id=\"" + strid +
onward and upward...
bopp out
|
|
|