Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4621666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:44:02+00:00 2026-05-22T02:44:02+00:00

I am using Fancybox to open up content in an iframe on my page,

  • 0

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:

  1. If the user goes directly to the link, redirect to the homepage and open in an iframe
  2. Give the user an alternate layout if the link is clicked from a link that doesn’t have class=”iframe”

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!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T02:44:03+00:00Added an answer on May 22, 2026 at 2:44 am

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using fancybox 1.2.1 to open an iframe. My problem is my width, height
I am using fancybox to open submitted form like this: <form name=form id=myForm action={$smarty.server.PHP_SELF}?action=abc
I'm using Fancybox ( http://fancybox.net ) to pop open an iFrame. In order to
I'm using fancybox to open an iframe that contains a submission form. The form
I'm using Fancybox 1.3.4 with the iframe setting which loads in another page into
This is my code to open a Fancybox that loads a page via ajax:
I'm using fancybox to load up some inline content on a web page. Fancybox
I am using this http://fancybox.net/ I have 2 div s: 1st open and 2nd
Im using this code to show on screen some fancybox message: $.fancybox( { content:
i am using fancybox function in jquery. i am opening loign box on click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.