Jump to content

Links target to iframe, but open in a new tab


rsrwebs

Recommended Posts

Hello again,

 

I've been having a problem with my hyperlinks targeted to iframes that I have never had before. When it's supposed to load the linked page in the iframe, it instead opens the link in a new tab.

 

What's strange is I have been able to get this to work before with no problems at all.

 

I tried even putting the links into the source page that first loads in the iframe, it STILL opens in a new tab.

 

The hyperlinks:

Videos 
           | Photos

 

The iframes:

 





 

All the formatting on these are being done with CSS, this is the code for them:

div#subnav
{
position: relative;
margin-left:auto;
margin-top:auto;
margin-right:auto;
text-align:center;
}

iframe#view
{
text-align:center;
width:600px;
height:300px;
}

iframe#thumbnails
{
overflow-y:hidden;
overflow-x:auto;
width:600px;
height:100px;
}

div#gallery
{
position: relative;
margin-left:20%;
margin-top:25%;
margin-right:auto;
text-align:center;
}

 

I really appreciate any help given. :)

-Raven

Link to comment
Share on other sites

I'm on really slow internet access at the moment, so I can't double check this, but I believe you also have to assign each iframe a name:

 

 

If I remember correctly, you have to set the iframe name in order to target it properly. Just give it the same name as the id.

 

If you haven't replied by the time I get back to proper high speed internet access, I'll double check.

Link to comment
Share on other sites

  • 2 weeks later...
I'm on really slow internet access at the moment, so I can't double check this, but I believe you also have to assign each iframe a name:

 

 

If I remember correctly, you have to set the iframe name in order to target it properly. Just give it the same name as the id.

 

If you haven't replied by the time I get back to proper high speed internet access, I'll double check.

 

I have an ID defined for each of them, and the links are targeted to the frame's ID, but the link always opens in a new window.

Link to comment
Share on other sites

  • 4 weeks later...
Yes, use name=".."

 

 

The id probably isn't needed unless you are using it for some other function.

 

That was it, I completely didn't notice it because I was focusing on the 'target' property in the links, and not whatever missing property that may have been in the iframe itself. I actually recall now, when I first got a hold of the iframe code, I was confused why there was an id and a name, and now I see why. The 'name' had to be there,and you couldn't just use 'id' alone. :lol:

 

Thanks a lot man, it means a lot.

Edited by rsrwebs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...