I'm including a page on my site with an iframe. The page in the iframe has the functionality to open a lightbox, which now of course opens in the iframe itself.
Is there a possibility that the iframe content opens the lightbox on the top frame? (On the page that includes this iframe)
if it's opening via javascript, use
window.top.location = "http://destination-url.com";
if it's a anchor link, then add
target="_top":
Related
We have implemented magnific pop-up to our website for internal links only. When a user clicks from an external link (i.e. Facebook, Google) we would like to load it without the pop-up. In fact there is a second template besides the one with the magnific pop-up for the same content (article) especially for this (external links). However when a user clicks an external link (direct link to the content) it first loads the content without the pop-up and on top of that it loads again the content with the pop-up. How can we eliminate the on top second loading for external links?
Example page
I have MAINPAGE.php which launches an iFrame. In this iFrame there can be any link opened and the user can click links and view different pages in the iFrame.
What I would like is that each time the user navigates to a page within the iFrame, the parent window will include the url of that page but just as a reference. So if I visit google in the iFrame the MAINFRAME.php should be changed to MAINFRAME.php#http://www.google.com. Then when I visit Yahoo, the url should be changed to MAINFRAME.php#http://www.yahoo.com.
This change should be textual only and should not affect navigation at all, so using _top or "top.window.location.href" and co. is not an option as it will exit the iFrame.
The idea is to have the ability to access the URL of the page in the iFrame from the URL of the parent.
Any idea?
open in new window
link 1
link 2
link 3
<iframe name="blah" src="blah.html" ></iframe>
I have a page with an iframe in it. I have links that open pages inside the iframe, so the iframe doesn't have just one constant source. I want there to be a link that will open whatever source is currently in the iframe into a new window, whether it be 1.html, 2.html, or 3.html, etc (more pages will constantly be added so there won't just be three in the future).
How would I implement this link? Thank you so much in advance! :~)
Try this,
$(function(){
$('a[target="blah"]').on('click',function(e){
e.preventDefault();
window.open(this.href,'blah');
});
});
This is a tricky one. I have a link on my page that opens a Colorbox iframe to an external website. The external website contains links to another page. When the user clicks those links, I need them to load up in the same iframe.
The problem is, the link on that external site is set to open a new window with target="_blank". Therefore, instead of this page loading within the same colorbox iframe like I need it to, it opens a totally new window.
Is there any way to bypass it so that these links within the iframe do not open a new window, and instead load that window within the same colorbox iframe?
Thanks in advance!
_blank will always open a new window, you could try _TOP instead, it should work something like this;
<a onclick="parent.$.fn.colorbox.close();" href="NEW SITE" target="_top">
open in parent window with animation
</a>
Do you control the document that is being displayed in the iframe? If so you could handle things a little differently so that you only opened new windows if the document isn't being displayed in an iframe. But if the document you are iframing isn't under your control then I don't think there is anything you can do about it.
I have developed a pop up extension for google chrome. I have added an iframe in that popup. Now when i try to open a link from that iframe.. its not working.. its not even working within the iframe itself. i need the links in iframe to be opened in a new tab.
I tried writing some scripts which can change href in a to be opened in a new tab or in the same tab. But how to do that for an iframe.
Note: The page loaded in iframe is in my control and can be changed if needed.
Put <base target="_blank"/> into <head> of that iframe. You can also mark individual links with target="_blank".