Click to See Complete Forum and Search --> : How to find the sizes of a IFRAME


NewUniverse
12-29-2004, 08:26 AM
I wan to make an IFRAME that has a web page in itself. I set IFRAME's sizes and no scrolling aiming to make it scrolling itself by JavaScript ( scrollBy(0,1) ). The JavaScript code is given in the document loaded in the IFRAME. It is working fine - looks well, scrolls but the problem arises when the web pages reaches its end. I want to make it start scrolling form the beginning when the end is reached by ScrollTo(0,0) but the problem is how to detect the end - when the page is fully scrolled. I used the offsetHeight but IE and Opera give dimentions different from Mozilla FireFox and NN.

In my sources it is every where written that it is impossible to make it work well. Do you have any idea or I will have to write Browser specific code.

I think that if I manage to find the size of the document I want to show in the I frame and I count the calls to scrollBy I'll make it work. So the problem will be how to find the real size of a document that is partially visible?

NewUniverse
12-30-2004, 05:03 AM
Well I managed to do it!!!!

I put a huge DIV in the frame's document with sizes 100% and by it's sizes I managed to find the size of the whole document. Then I scrolled down until I scroll it's all height. Meanwhile in the frame only a part of it was visible!!!!

May be my mind was stuck with info... and I couldn't make it so quickly...