0

I am using the fancybox iframe (as can be seen here in the iframe demo) http://fancyapps.com/fancybox/demo/

Here is the code i am using

 <p><a class="fancybox fancybox.iframe" href="items/item1.html"><span>Item 1</span></a>

I then have item1.html that has the following code:

<h3>Item 1</h3>
Blah blah blah text here
<a href="http://www.google.com"><img src="https://www.google.com/images/srpr/logo3w.png" width="160" height="25" border="0" alt="Google logo" /></a>

The fancybox pop up window works and pops up after clicking the items 1 link, however, once the fancybox is open and i can see the blahblah text and also the google logo, when i click the logo - the www.google.com should load but it doesn't. What am i doing wrong?

Thanks,

Daniel

user1424500
  • 3
  • 1
  • 2

3 Answers3

0

Is the problem that it is opening inside the fancybox? If so you can add a target="_blank" to the href and it will open in a new tab/window. The html in your document that is iFramed will look like this:

<h3>Item 1</h3>
  Blah blah blah text here
  <a target="_blank" href="http://www.google.com">
     <img src="https://www.google.com/images/srpr/logo3w.png" width="160" height="25" border="0" alt="Google logo" />
  </a>
sellandb
  • 346
  • 1
  • 7
  • No the problem is that I WANT it to open in the fancybox, but it isn't! When I click the google image link, nothing happens. The page looks like it reloads but nothing happens. – user1424500 May 29 '12 at 20:18
0

You can't open goolge inside fancybox or in any other lightbox, check https://stackoverflow.com/a/8808761/1055987 for more.

Change it to any other URL, preferably one of your own.

Community
  • 1
  • 1
JFK
  • 40,963
  • 31
  • 133
  • 306
  • Actually I just gave google as an example, its a different external website (LinkedIn). – user1424500 May 29 '12 at 20:20
  • Most of the big players (google, facebook, linkedin, yahoo, etc.) don't like to be contained within iframes. Try with another one ... yours for example. – JFK May 29 '12 at 20:22
  • It's mostly due to the SAMEORIGIN policy (The page can only be displayed in a frame on the same origin as the page itself.) – JFK May 29 '12 at 20:24
0

Web sites with sensitive user data often block framing by adding an HTTP header callled X-Frame-Options to their pages to prevent clickjacking attacks. There isn't much that you can do about it, other than proxying the page through your own server.

user2428118
  • 7,935
  • 4
  • 45
  • 72