[Pro] ScriptyLightbox 2 Close within

Hi all,

Anyone know if it’s possible to close a scriptylightbox from a link within an iframe?

Thanks,

Seb


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Is the iframe in question being shown within the lightbox?

Walter

On Nov 8, 2012, at 9:53 AM, Sebastian Crewe-Turrell wrote:

Hi all,

Anyone know if it’s possible to close a scriptylightbox from a link within an iframe?

Thanks,

Seb


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walter,

Sorry, yes it is. I don’t have a link to share at the moment.

Seb


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Okay, then next question – is the iframe content from within your site or from a third-party site? If it’s from within your site, did you create the page that holds it as a fragment, or a full page?

Here’s why this matters: JavaScript has a “sandbox” that prevents a script running in one domain from affecting anything outside of that domain. Further to this, frames have their own security model, preventing an iframe’s content from changing the parent page’s content. The most you can do is send a signal to the parent page, asking it to run a script that already exists there.

But here’s where it gets really witchy – ScriptyLightbox (not ScriptyLightbox2) requires that any page you host locally and display in the lightbox interface be a page fragment – just the content of the tag, not the entire html page. The way to get this in Freeway is to use the PHP Make Insert Page Action to cut down the page you plan to include in the lightbox. And this has the effect of stripping off any scripts you have added to the portion of the page.

If the page you’re showing in the lightbox is hosted at a different domain than the parent page, then an iframe (ironically) is dynamically created to hold the foreign content, getting around the JavaScript cross-domain request rules. But also making it exponentially harder to get at the top-most parent page and ask it to do anything. By my reckoning, at this point you’d be in an iframe within an iframe.

So you’re disadvantaged on several levels here, depending on how you’ve structured your content. I’m not ruling out that this is possible, but it’s likely to be difficult at the least. If you’ve got anything in the way of an example that you could show, it might make it easier to figure out a way through the maze.

Walter

On Nov 8, 2012, at 11:01 AM, Sebastian Crewe-Turrell wrote:

Hi Walter,

Sorry, yes it is. I don’t have a link to share at the moment.

Seb


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

The content is just another page built within my Freeway document.

It’s holding it as a whole page I believe. (may have misunderstood your question)

Thanks for the all the in-depth information, my brain is just trying to interpret it all. However from what I gather, this may be difficult…

I have done this type of thing before, however I was using a JQuery Lightbox “fancybox” which was telling the parent page to close the iframe.

The reason I’m using scripty is because obviously my nice rollovers won’t play nice with Jquery…

I’ve managed to get up a link for you. Click on “choose your book” and click on the beatles book. The lightbox should pop up.

http://rslimitededitions(dotcom)/readingroom

I’m thinking I’ll just recreate all of the “slider/book gallery” with HYPE and then use fancybox…?

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It looks as though you have a mixture of fancy box and ScriptyLightbox already in that page. Here are the errors thrown by the page:

  • ReferenceError: Can’t find variable: jQuery jquery.fancybox.pack.js:45
  • TypeError: ‘null’ is not an object (evaluating ‘$(".fancybox").attr’) readingroom:136
  • Failed to load resource: the server responded with a stutus of 404 (Not Found) http://rslimitededitions(dot)com/readingroom/flipbook/css/basic.css
  • Failed to load resource: the server responded with a status of 404 (Not Found) http://rslimitededitions(dot)com/readingroom/flipbook/css/basic.css

Can you try a new page, entirely from scratch, and see if you can get there with the FX and Scripty Actions alone? I don’t see anything in this page that requires more than you get there. For a start, just leave out the flip book stuff on the target pages at first. Let’s just see if you can load a simple page from within the same server.

ScriptyLightbox already includes a close button, which you can style to appear anywhere on the screen and in any manner that you like using a little extra CSS. You might also like ScriptyLightbox2, which is visually similar to what you have going on here (no darkened overlay) and also features a close button. Unlike ScriptyLightbox, SL2 always uses an iframe to show HTML pages, so there’s no need to create a cut-down page fragment.

Walter

On Nov 8, 2012, at 11:25 AM, Sebastian Crewe-Turrell wrote:

The content is just another page built within my Freeway document.

It’s holding it as a whole page I believe. (may have misunderstood your question)

Thanks for the all the in-depth information, my brain is just trying to interpret it all. However from what I gather, this may be difficult…

I have done this type of thing before, however I was using a JQuery Lightbox “fancybox” which was telling the parent page to close the iframe.

The reason I’m using scripty is because obviously my nice rollovers won’t play nice with Jquery…

I’ve managed to get up a link for you. Click on “choose your book” and click on the beatles book. The lightbox should pop up.

http://rslimitededitions(dotcom)/readingroom

I’m thinking I’ll just recreate all of the “slider/book gallery” with HYPE and then use fancybox…?

Thanks again


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Walt,

Ah yep, I accidentally left the script links in the header which is why it’s giving you errors.

I’ve just been playing around with hype and have made a nice little animation that I am going to use instead.

This example should be using ScriptyLightbox 2 anyway? It’s the action I’m using.

I may style the close button and use that Instead, I didn’t think of that…

Thanks for all your help and I’ll post a completed link soon to show what I’ve done for people with similar issues or people who care!?

Thanks,

Seb


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options