views:

177

answers:

2

OK, so here is my issue. I'm building a system which will allow people to embed lists of links on their pages. When the link is clicked, i'd like to use something like Lightview or Lightwindow to open it up over the whole window, not just in the iframe.

I don't have access to the page that the user will be embedding this object into. Everything I've tried so far tells me that I can't open anything over the parent window, since I don't have access to it from the iframe or object, javacript security issue.

However, I've seen sites that do that kind of overlay. so it must be possible. If anyone can point me to any resources that could help, that would be great.

if it matters, i'm using Ruby on Rails...

Thanks...chris

+1  A: 

It can't be done if the iframe is from another domain than the website, because:

  1. You cannot change the dimensions of the iframe from within it.
  2. You cannot access the parent document from within the iframe.

I suggest trying using some sort of JS file people will embed in they're website, in the place they want your links to be (something like Google Ads) and do a document.write to place your links in their webpage. then, you will have access to the page, and can do a whole lot more :)

is this helping you?

vsync
great thanks! is there someplace on the web where I can see some examples of the code that creates those kind of ads? Thanks....!
thinkfuture
well..i can't think of one now from the top of my head, but you'd have to know Javascript pretty much well to achieve the thing you want..
vsync
A: 

As vsync said, you will have to have the user embed a script instead of the plain HTML.

This script has full control of the page, and if you also want it to be able to communicate with the framed document (your site), then you could use something like easyxdm to do cross document communication.

Sean Kinsey