PDA

View Full Version : Prevent scrolling in iFrame?


LoKi
07-24-2006, 07:30 AM
Hello all,

I am using an iFrame to display an external webpage which is on a free server (with ads at the bottom). Is there any way to fix the height of the iFrame so that it will not scroll down to display the advert?

I have tried setting scrollbar to 'no', but the frame still scrolls even though there is no scrollbar.

Any help would be greatly appreciated!

LoKi :unsure:

abcohen
07-24-2006, 12:49 PM
Well, no matter what you cant tell a iframe not to scroll when the page length is bigger then the frame size... so the answer is sadly know...

I'm sure there is javascript that would keep bouncing a user to the top half only but it'll get messy when you click on different pages with different hieghts.

Robert_J_Ellis
07-24-2006, 01:28 PM
The way you get around that it to make sure the body has a fixed size, the same size as the iframe. There are a majority of ways to accomplsh this, some using css and others using old deprecated code. This was one of the challnges which I faced when making the noscript iframe menu.


body {
overflow-y:hidden;
}


or non xhtml valid <body scrolling="no">.

Good luck :).

LoKi
08-04-2006, 12:07 PM
Thanks for your help guys&#33;