Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Need Iframe Help!


  • Please log in to reply

#1
cassi3e11a

cassi3e11a

    New Member

  • Member
  • Pip
  • 5 posts
I am trying to figure out how to hover or click on a link or image in my Iframe and be able to change an image on the parent webpage.

I found some help online on the subject:

The document located inside the iframe can refer to any object available in the document containing the iframe via the parent keyword. For example:

parent.document.getElementById(id)


but when I tried it, I still keep getting script errors

If anyone could help me it would be greatly appreciated!

Thanks,
Cassie
  • 0

Advertisements


#2
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Maybe posting what you have might help.

Ron
  • 0

#3
cassi3e11a

cassi3e11a

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
I am using this script:

<script type="text/javascript">
onload="loadImgs()"
// image construct begin
var imgArray = new Array()
var imgNames = new Array()
function loadImgs() {
var i=0;
while (i<imgNames.length) {
imgArray[i] = new Image()
imgArray[i].src = imgNames[i]
i++
}
}
function setToLoadImg(imgName) {
var nextNum = imgNames.length
imgNames[nextNum] = imgName
return nextNum
}
function setImg(x,y) {
document.images[x].src = imgArray[y].src
}
// image contruct end
var img1 = setToLoadImg("images/animecover.jpg");
var img2 = setToLoadImg("images/mangacover.jpg");
var img3 = setToLoadImg("images/konnichiwa.gif");
var img4 = setToLoadImg("profiles/major/pictures/anime/inuyashahanyou.jpg");
var img5 = setToLoadImg("profiles/major/pictures/manga/inuyashahanyou.jpg");
var img6 = setToLoadImg("profiles/major/names/inuyasha.jpg");
var img7 = setToLoadImg("thumbnails/miroku.gif");
var img8 = setToLoadImg("thumbnails/naraku.gif");
var img9 = setToLoadImg("thumbnails/sango.gif");
var img10 = setToLoadImg("thumbnails/kirara.gif");
var img11 = setToLoadImg("thumbnails/kouga.gif");
function si(imgName,imgNum) {
//imgNames is set up by the images' construct
imgName.src=imgNames[imgNum]
}
</SCRIPT>


with this attached to the word:

<a href="inuyasha.html" onclick="parent.document.whopic2.img4;parent.document.whopic3.img5;parent.document.whopic4.img6;parent.right.location.href='stats.inuyasha.html'">Inuyasha</a>

where, when you look at the picture below, whopic2=pic1, whopic3=pic3, whopic4=pic2, & right=iframe2.

I keep getting the script error "access is denied" and I don't know how to fix it.
At one point everything was working with no script error, however, it didn't know where to find the pictures or html docs.

If you could help me, that would be wonderful! Thanks!

Attached Thumbnails

  • help.jpg

  • 0

#4
cassi3e11a

cassi3e11a

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
When I typed the following, I messed up. It should really say what's in red.

<a href="inuyasha.html" onclick="parent.document.whopic2.img4;parent.document.whopic3.img5;parent.document.whopic4.img6;parent.right.location.href='stats.inuyasha.html'">Inuyasha</a>

<a href="inuyasha.html" onclick="si(parent.document.whopic2,img4);si(parent.document.whopic3,img5);si(parent.document.whopic4,img6);parent.right.location.href='stats.inuyasha.html'">Inuyasha</a>

sorry about any confusion.
Thanks.
  • 0

#5
cassi3e11a

cassi3e11a

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
I finally got the page back to where it is doing what I want it to, just not knowing where to find the pictures.

If you want to look at it, it's at this address:

Cassandra's Inuyasha Page

If you click on "major characters", then "Inuyasha" you will see what I am talking about.

Thanks for the help....it's greatly appreciated!
  • 0

#6
Major Payne

Major Payne

    Retired Staff

  • Retired Staff
  • 5,307 posts
Hi :

Sorry for delay in getting back to you. Bad storm here and I shut down. I looked at your page. Really terrific site.

I must be in a fog still as I don't seem to get the problem you are having with the links. I did what you suggested and all the pix showed up fine except for the pair for Kirara.

Are you wanting the pair of images to provide links to another page? Right now the images do not stay except when you hold the mouseover on the names.

I got no script errors using Firefox. Just the one set of dead images mentioned. Will wait for your reply.

Ron
  • 0

#7
cassi3e11a

cassi3e11a

    New Member

  • Topic Starter
  • Member
  • Pip
  • 5 posts
Thanks for looking!

I'm not having any problems with the mouseover images, but with the set of "dead images" that you mentioned. When I click on the link for "Inuyasha" the images that I want to appear, do not. I can't figure out how to source the pictures. I've tried it several different ways, from severral different places.

Have any suggestions?

Here is the page that the link is on if you need to see the source of that page:

Major Character Directory

Thanks so much for your help!
Cassie
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP