This project is archived and is in readonly mode.

#14 ✓invalid
Thomas Aylott

Fx.Scroll. max scroll impossible if there is border or scrollLine.

Reported by Thomas Aylott | May 28th, 2008 @ 09:59 AM

Originally posted on Trac by magmoro@…

Original Trac Ticket

Description

It's imposible full scroll with Fx.Scroll . Here example (strict mode):

http://theocp.info/studio/moro/F...

If u even set x or y very big u get not full scroll.

It because u use offsetWidth and offsetHeight (el.size[z]) when calculate max:

var el = this.element.getSize();

var values = {'x': x, 'y': y};

for (var z in el.size){

var max = el.scrollSize[z] - el.size[z];

...

U shoud use clienWidth and clientHeight.

Fix:

var el = this.element.getSize();

el.size={

x : this.element.clientWidth,

y : this.element.clientHeight

}

var values = {'x': x, 'y': y};

for (var z in el.size){

var max = el.scrollSize[z] - el.size[z];

Here fixed example:

http://theocp.info/studio/moro/F...

Tested in FF2 IE6 Opera 9.

Note: still there is some issue in Opera if padding!=0.

Trac Attachments

Trac Comments

Changed 9 months ago by kamicane


        
clientWidth/clientHeight are not crossbrowser element properties. 

                  Changed 9 months ago by kamicane

          status
              changed from new to closed
        
          resolution
              set to wontfix

clientWidth/clientHeight are not crossbrowser element properties. 

          status
              changed from new to closed
        
          resolution
              set to wontfix
        
      

Changed 9 months ago by magmoro@…


        
why not crossbrowser? http://www.quirksmode.org/js/ele... 

scrollSize is size of content and paddings 

clientSize is size of visible content and paddings 

offsetSize is size of visible content and paddings + scrollBar + border 

must be scrollSize-clientSize, not scrollSize-offsetSize. 

scrollSize-offsetSize

scrollSize-offsetSize not max if there is border or scrollBar. 

                  Changed 9 months ago by magmoro@…

          status
              changed from closed to reopened
        
          resolution
            deleted

why not crossbrowser? http://www.quirksmode.org/js/ele... 

scrollSize is size of content and paddings 

clientSize is size of visible content and paddings 

offsetSize is size of visible content and paddings + scrollBar + border 

must be scrollSize-clientSize, not scrollSize-offsetSize. 

scrollSize-offsetSize

scrollSize-offsetSize not max if there is border or scrollBar. 

          status
              changed from closed to reopened
        
          resolution
            deleted
        
      

Changed 9 months ago by kamicane


        
I remember trying clientWidth/Height in ie6, and it gave me problems. Do you have a (working) test page? 

                  Changed 9 months ago by kamicane

          status
              changed from reopened to closed
        
          resolution
              set to wontfix

I remember trying clientWidth/Height in ie6, and it gave me problems. Do you have a (working) test page? 

          status
              changed from reopened to closed
        
          resolution
              set to wontfix
        
      

Changed 9 months ago by magmoro@…


        
what type of problems? no problems for me. 

http://www.xp-computers.ru/moro/... 

                  Changed 9 months ago by magmoro@…

          status
              changed from closed to reopened
        
          resolution
            deleted

what type of problems? no problems for me. 

http://www.xp-computers.ru/moro/... 

          status
              changed from closed to reopened
        
          resolution
            deleted
        
      

Changed 8 months ago by kamicane


        
fixed in [998] 

                  Changed 8 months ago by kamicane

          status
              changed from reopened to closed
        
          resolution
              set to fixed

fixed in [998] 

          status
              changed from reopened to closed
        
          resolution
              set to fixed
        
      

Changed 7 months ago by magmoro@…


        
fix is broken. Fx.Scroll now use offsetSize not a clientSize 

                  Changed 7 months ago by magmoro@…

          status
              changed from closed to reopened
        
          resolution
            deleted
        
          component
              set to Plugins

fix is broken. Fx.Scroll now use offsetSize not a clientSize 

          status
              changed from closed to reopened
        
          resolution
            deleted
        
          component
              set to Plugins
        
      

Changed 3 months ago by kamicane


        
for posterity, clientWidth and clientHeight only work in explorer when the element has a layout (hasLayout) 

A possible fix is to add this layout by adding the zoom style to ie. 

Another possible fix is reading the border values to manually calculate the client dimensions, but that would only work if borders are set in pixels. 

      

Changed 2 weeks ago by tomocchino



                  Changed 2 weeks ago by tomocchino

          priority
              changed from major to minor
        
          milestone
              changed from Mootools version 1.2 to Mootools version 1.3

          priority
              changed from major to minor
        
          milestone
              changed from Mootools version 1.2 to Mootools version 1.3
        
      

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Tags

Pages