Floatbox and Iframes.

Page: 1

Author Post
Bbarnes
Guest
Okay, I have a website that I'm using floatbox on (http://www.alexandergradyyoung.com) and in the 'portfolio' section is where you'll find it.

If you notice, the floatbox seems to be constrained within the iframe and this is causing the image to seem small and poorly sized. Is there any way to make the floatbox break away from the Iframe when it opens in lightbox?
Administrator
Registered: Aug 2008
Posts: 3382
There's a number of things to address here.

1. Your page doesn't render at all in some browsers. It's because you start a <style> element in the head section but never close it, so some browsers interpret the entire page as being a style definition. Get rid of that unclosed <style> tag on your base page.

2. That base page has an include line for floatbox.js but it also needs one for floatbox.css. Add <link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" /> to the head section of your base page.

3. Iframes need to be on the same domain in order for floatbox to attach across iframe boundaries. This is because javascript blocks cross-domain execution. You are accessing your base page with the www prefix on your domain name, but are setting your iframe src without the www prefix, so they are different domains. You should remove the domain information entirely from your iframe src. (And from the other same-domain hrefs on the page as well.) So:
<iframe src="http://alexandergradyyoung.com/content.html"
becomes:
<iframe src="/content.html"
Now the iframe will always be from the same domain as the parent page regardless of whether the page was accessed using www or not. (Or accessed by "localhost" or ip address or whatever.)

I'm sure with these changes you will find enduring joy and happiness. :D
Bbarnes
Guest
wow! Thank you so much for that! Not only did you address the problem but you addressed everything that needed fixing. I used dreamweaver so I assumed everything would be to a 'T'! I guess I may have edited and didn't fix stuff. Thank you so much! I'll give this a try and see what comes of it!

thank you again :D
Bbarnes
Guest
It worked perfectly! However, I can't find the unclosed style tag you were talking about. :|
Administrator
Registered: Aug 2008
Posts: 3382
It ain't there no more. Well, it's there, but now it's got a body style in it and it's closed after that. So everything is cool.

Page: 1