Reputation: 6896
I am using Fancybox to open up content in an iframe on my page, and it is working great.
This content has a share bar in it however, and when you click on the link posted on social media, it takes you directly to the content without opening it in an iframe, so the layout is all screwy.
I want to be able to either do:
I am using Rails 3 to build my site, and I found this post about opening the content in an iframe automatically, the problem is if a user clicks on the link on my site (with class="iframe") it opens an iframe within the iframe!
Is there a good workaround for this?
Does this make sense?
Thanks!!
Upvotes: 0
Views: 475
Reputation: 1447
In javascript you can check to see if the page is already in an iframe
var isInIFrame = (window.location != window.parent.location) ? true : false;
You can do this check onclick to decide whether or not to load the content in an iframe.
Is this helpful? I'm not sure that I completely understand the question.
Upvotes: 1