You might be wondering why I'm using:

this.iframe.setStyle( 'height', decreasedHeight );
this.iframe.contentWindow.scrollTo( null, 1 );

together. Indeed it's confusing, but this.iframe dosn't have scrollTo
property and this.iframe.contentWindow.setStyle is also undefined.
Ugh.

On márc. 5, 15:50, ZsZs <[email protected]> wrote:
> Hi,
>
> I'm using the code below to automatically adjust an iframe's heigh
> according to it's content.
>
>    tryToDecreaseHeight: function(){
>       while( this.iframe.contentWindow.getScroll().y == 0 &&
> this.iframe.getStyle( 'height' ).toInt() > 0 ) {
>          var currentHeight = this.iframe.getStyle( 'height' ).toInt();
>          var decreasedHeight = ( currentHeight -
> this.options.estimatedRowHeight ) >= 0 ? currentHeight -
> this.options.estimatedRowHeight : 0;
>          this.iframe.setStyle( 'height', decreasedHeight );
>          this.iframe.contentWindow.scrollTo( null, 1 );
>       }
>
>       if( this.iframe.contentWindow.getScroll().y > 0 )
>          this.iframe.setStyle( 'height',
> this.iframe.getStyle( 'height' ).toInt() +
> this.options.estimatedRowHeight );
>    }.protect(),
>
> Please note that there is a similar tryToIncreaseHeight() method.
> Both are working properly in Chrome, FF, Safari, but in IE the line:
>          this.iframe.contentWindow.scrollTo( null, 1 );
> doesn't changes this.iframe.contentWindow.getScroll().y value.
>
> Any idea what is special in IE?
> Thank you,
> Zsolt

Reply via email to