Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #19954 > unrolled thread

Scroll position detection

Started byTuxedo <tuxedo@mailinator.com>
First post2013-05-25 12:08 +0200
Last post2013-05-27 21:24 +0000
Articles 4 on this page of 24 — 6 participants

Back to article view | Back to comp.lang.javascript


Contents

  Scroll position detection Tuxedo <tuxedo@mailinator.com> - 2013-05-25 12:08 +0200
    Re: Scroll position detection "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2013-05-25 13:12 +0200
      Re: Scroll position detection Tuxedo <tuxedo@mailinator.com> - 2013-05-25 16:02 +0200
      Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 01:07 -0300
        Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 11:48 +0200
          Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 09:33 -0300
            Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 14:39 +0200
              Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 11:33 -0300
                Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 16:42 +0200
            Re: Scroll position detection Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-27 12:37 +0000
              Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 09:57 -0300
                Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 16:45 +0200
                  Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 11:58 -0300
                    Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 17:27 +0200
                      Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 13:12 -0300
                        Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 19:41 +0200
                          Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 15:24 -0300
                            Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-27 21:10 +0200
                              Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 18:35 -0300
                                Re: Scroll position detection Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-05-28 00:00 +0200
                      Re: Scroll position detection Stefan Weiss <krewecherl@gmail.com> - 2013-05-28 02:30 +0200
        Re: Scroll position detection Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-27 10:16 +0000
          Re: Scroll position detection Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2013-05-27 09:45 -0300
            Re: Scroll position detection Denis McMahon <denismfmcmahon@gmail.com> - 2013-05-27 21:24 +0000

Page 2 of 2 — ← Prev page 1 [2]


#19992

FromStefan Weiss <krewecherl@gmail.com>
Date2013-05-28 02:30 +0200
Message-ID<ko0tqu$4db$1@news.albasani.net>
In reply to#19978
On 2013-05-27 17:27, Thomas 'PointedEars' Lahn wrote:
> Joao Rodrigues wrote:
>> But tell me: is there any reason to not test for pageYOffset support first
>> in the OP's code?
> 
> I will not waste more time to consider that question – [vitriolic rhetorics
> elided].  May you die in ignorance. [whoops, missed one]

You have managed to avoid answering the only clear and practically
relevant question in this sub-thread. Let me give you a new target for
your spitballs and answer it:

  At this time, there is no good reason not to try pageYOffset first.

Double negative removed for clarity:

  Do try pageYOffset first.


> Score adjusted

Curtains adjusted.
I hope you are all as interested in my curtains as I am.


- stefan

[toc] | [prev] | [next] | [standalone]


#19968

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-05-27 10:16 +0000
Message-ID<knvbqb$gvn$2@dont-email.me>
In reply to#19965
On Mon, 27 May 2013 01:07:41 -0300, Joao Rodrigues wrote:

> The W3C standard is pageYOffset:
> <http://www.w3.org/TR/cssom-view/#dom-window-pageyoffset>
> 
> Also see:
> <http://www.quirksmode.org/dom/w3c_cssom.html>
> 
> and <https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY>
> 
> So, nowadays we need to test for pageYOffset before testing for the
> proprietary scrollTop. E.g

Hmm, tried that, ff 21 under linux ubuntu 12.04.2 lts, and none of them 
seem to give any data.

    function xyPos() {
        var str = "";
        if ( window.pageXOffset || window.pageYOffset )
            str += "[ " +
                   window.pageXOffset +
                   ", " +
                   window.pageYOffset +
                   " ] from window.pageX/YOffset\n";
        if ( document.documentElement &&
             ( document.documentElement.scrollLeft ||
               document.documentElement.scrollTop ) )
            str += "[ " +
                   document.documentElement.scrollLeft +
                   ", " +
                   document.documentElement.scrollTop +
                   " ] from document.documentElement.scrollLeft/Top\n";
        if ( document.body &&
             ( document.body.scrollLeft ||
               document.body.scrollTop ) )
            str += "[ " +
                   document.body.scrollLeft +
                   ", " +
                   document.body.scrollTop +
                   " ] from document.body.scrollLeft/Top\n";
        if ( str == "" )
            str = "no xy data found";
        alert( str );
    }

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#19972

FromJoao Rodrigues <groups_jr-1@yahoo.com.br>
Date2013-05-27 09:45 -0300
Message-ID<knvkho$m3a$1@speranza.aioe.org>
In reply to#19968
On 27/05/2013 07:16, Denis McMahon wrote:
> On Mon, 27 May 2013 01:07:41 -0300, Joao Rodrigues wrote:
>
>> The W3C standard is pageYOffset:
>> <http://www.w3.org/TR/cssom-view/#dom-window-pageyoffset>
>>
>> Also see:
>> <http://www.quirksmode.org/dom/w3c_cssom.html>
>>
>> and <https://developer.mozilla.org/en-US/docs/Web/API/window.scrollY>
>>
>> So, nowadays we need to test for pageYOffset before testing for the
>> proprietary scrollTop. E.g
>
> Hmm, tried that, ff 21 under linux ubuntu 12.04.2 lts, and none of them
> seem to give any data.
>
>      function xyPos() {
>          var str = "";
>          if ( window.pageXOffset || window.pageYOffset )
>              str += "[ " +
>                     window.pageXOffset +
>                     ", " +
>                     window.pageYOffset +
>                     " ] from window.pageX/YOffset\n";
>          if ( document.documentElement &&
>               ( document.documentElement.scrollLeft ||
>                 document.documentElement.scrollTop ) )
>              str += "[ " +
>                     document.documentElement.scrollLeft +
>                     ", " +
>                     document.documentElement.scrollTop +
>                     " ] from document.documentElement.scrollLeft/Top\n";
>          if ( document.body &&
>               ( document.body.scrollLeft ||
>                 document.body.scrollTop ) )
>              str += "[ " +
>                     document.body.scrollLeft +
>                     ", " +
>                     document.body.scrollTop +
>                     " ] from document.body.scrollLeft/Top\n";
>          if ( str == "" )
>              str = "no xy data found";
>          alert( str );
>      }
>

Hi,
Strange, I've been using pageYOffset since Feb 2011 and haven't found 
problems in FF since then. Maybe you haven't scrolled the page downwards 
before executing the code...

Cheers,
Joao Rodrigues

[toc] | [prev] | [next] | [standalone]


#19986

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-05-27 21:24 +0000
Message-ID<ko0iut$a5h$2@dont-email.me>
In reply to#19972
On Mon, 27 May 2013 09:45:45 -0300, Joao Rodrigues wrote:

> Maybe you haven't scrolled the page downwards
> before executing the code...

*headdesks*

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.javascript


csiph-web