Forum Moderators: not2easy

Message Too Old, No Replies

Force scroll bars if iframe exceeds page height

         

DougWD

8:14 am on Dec 19, 2010 (gmt 0)

10+ Year Member



Until I can get a real solution to embedding Gallery3 into my site, I'm using, or I should say, trying to use an iframe. The below works to expand the height 100%, but the browser scroll window does not understand that there is content below it's height. So lets say you have more content in the iframe that the browser is tall, the browser scroll bar will not allow you to scroll down through it--it thinks there is nothing on the page.

This is how I'm doing the heigth trick:
It works in FF 3.6x and IE 8

html, body, div, iframe { margin:0; padding:0; height:100%; }
iframe { display:block; width:100%; border:none; }

No js required!

The trick is to add css to the "html" element also.

Anyway to work around this?

[edited by: alt131 at 12:15 am (utc) on May 17, 2011]
[edit reason] Thread Tidy [/edit]

milosevic

10:35 am on Dec 20, 2010 (gmt 0)

10+ Year Member



Hi Doug, I thought about this approach to embedding Gallery 3, in the end I just edited the theme so it blended in with the rest of my website.

One thing you could try is adding overflow:auto to the css for the iframe and see if you get scrollbars.

BTW I should say that some might consider your site NSFW, it's prob good manners to mention that you have near-naked women on the front page.

DougWD

11:11 am on Dec 20, 2010 (gmt 0)

10+ Year Member



I can get the iframe scroll bars to show by using scrolling="yes" in the iframe tag. But I don't want scroll bars in the frame. I just want the browser scoll bar to understand that there is more information below the bottom border of the browser. It doesn't see that within the iframe there is more information.

milosevic

10:54 am on Dec 22, 2010 (gmt 0)

10+ Year Member



Yeah I don't know if you can do this Doug - I don't even know if it would be possible to hook in a jquery function to set the height of the iframe.

I'd say, try editing your theme/views/page.tpl.php file rather than using an iframe, it's actually easier than you'd think to stick a custom header and footer in, more or less copy and paste the HTML at the top and bottom of the file, and add a link to your CSS.

This is an issue though as I have one site that *has* to be integrated like G2 could be and I can't upgrade it to G3 at the moment.

DougWD

11:08 am on Dec 22, 2010 (gmt 0)

10+ Year Member



Yeah I'm trying to change the php file now, but in G3 it's called page.html.php. I embedded G2 but it was a pain and I never got it like I wanted it. It did work though. Thanks for the help.

milosevic

11:06 am on Dec 23, 2010 (gmt 0)

10+ Year Member



Good call DougWD, that's what it's called in Drupal :)

Yeah G2 embedding wasn't that great, it really should have been easier to embed content from your gallery in your site outside of the Gallery section, without needing a special module to link things together. I hope that G3 gains some decent functionality in this area