Detecting onmouseup outside browser window?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mandy Memphis

    Detecting onmouseup outside browser window?

    If I perform a mousedown within a document, move the mouse outside the
    browser window, and then release the mouse button, the document.onmous eup
    event does not fire. Is there any way to detect a mouseup event outside the
    document?

    Also, how can I get the relative coordinates of the cursor while it is
    outside the browser?

    Thank you.


  • Randy Webb

    #2
    Re: Detecting onmouseup outside browser window?

    Mandy Memphis wrote:[color=blue]
    > If I perform a mousedown within a document, move the mouse outside the
    > browser window, and then release the mouse button, the document.onmous eup
    > event does not fire. Is there any way to detect a mouseup event outside the
    > document?[/color]

    No.
    [color=blue]
    > Also, how can I get the relative coordinates of the cursor while it is
    > outside the browser?[/color]

    You can't.



    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javas cript FAQ - http://jibbering.com/faq/

    Comment

    • Mandy Memphis

      #3
      Re: Detecting onmouseup outside browser window?

      "Randy Webb" <hikksnotathome @aol.com> wrote in message
      news:8YednZ5qar lMHXTdRVn-jA@comcast.com. ..[color=blue]
      > Mandy Memphis wrote:[color=green]
      > > If I perform a mousedown within a document, move the mouse outside the
      > > browser window, and then release the mouse button, the[/color][/color]
      document.onmous eup[color=blue][color=green]
      > > event does not fire. Is there any way to detect a mouseup event outside[/color][/color]
      the[color=blue][color=green]
      > > document?[/color]
      >
      > No.
      >[color=green]
      > > Also, how can I get the relative coordinates of the cursor while it is
      > > outside the browser?[/color]
      >
      > You can't.[/color]

      Hi Randy,

      Walter Zorn has managed it. See here:

      Masuki dunia hiburan digital premium bersama RRQ88. Hadir dengan teknologi modern, akses instan, desain elegan, dan pengalaman online yang nyaman kapan saja.


      I just wish his code wasn't so cryptic!


      Comment

      • Andrew Thompson

        #4
        Re: Detecting onmouseup outside browser window?

        On Mon, 5 Jul 2004 13:15:03 -0400, Mandy Memphis wrote:[color=blue]
        > "Randy Webb" <hikksnotathome @aol.com> wrote in message[color=green]
        >> Mandy Memphis wrote:[color=darkred]
        >>> If I perform a mousedown within a document, move the mouse outside the
        >>> browser window, and then release the mouse button, the[/color][/color]
        > document.onmous eup[color=green][color=darkred]
        >>> event does not fire. Is there any way to detect a mouseup event outside[/color][/color]
        > the[color=green][color=darkred]
        >>> document?[/color]
        >>
        >> No.
        >>[color=darkred]
        >>> Also, how can I get the relative coordinates of the cursor while it is
        >>> outside the browser?[/color]
        >>
        >> You can't.[/color][/color]
        ...[color=blue]
        > Walter Zorn has managed it. See here:
        >
        > http://www.walterzorn.com/dragdrop/dragdrop_e.htm[/color]

        You assertion does not seem to be borne out
        by the way the code acts.

        E.G. If you make your browser window 'little' and
        put it in the middle of the screen, you can drag
        the mouse out of the window on the right, the image
        will keep scrolling (too the right). While the image
        keeps scrolling (within the web page), you can move
        the mouse pointer around the outside of the window,
        when you enter it on the left, the script seems to
        recognize *that* and the image which was still scrolling
        right now jumps to the left of the screen.

        That behaviour supports what Randy was saying,
        the script is not aware of the co-ords of the
        mouse when it is beyond the window.

        It is a security thing AFAIU, you do not want some
        script from a web-page able to monitor what you
        do beyond the browser, that could allow all sorts
        of nasty snooping.

        --
        Andrew Thompson
        http://www.PhySci.org/ Open-source software suite
        http://www.PhySci.org/codes/ Web & IT Help
        http://www.1point1C.org/ Science & Technology

        Comment

        • Matt Kruse

          #5
          Re: Detecting onmouseup outside browser window?

          Andrew Thompson wrote:[color=blue][color=green]
          >> Walter Zorn has managed it. See here:
          >> http://www.walterzorn.com/dragdrop/dragdrop_e.htm[/color]
          > You assertion does not seem to be borne out
          > by the way the code acts.[/color]

          On the contrary, it works for me.
          If I resize my browser (IE6) to the middle of the screen, I can drag
          something off to the left. While my cursor is outside of the browser window
          completely, I can still move the image around (and my cursor stays as a
          'move' graphic). When I let go, outside of the browser window, it stops
          dragging. This was the behavior that the OP was asking for, I believe.

          Mandy Memphis wrote:[color=blue]
          > I just wish his code wasn't so cryptic![/color]

          Me too, he has some good functions in there. But trying to reuse or alter
          any of them is more work than it's worth...

          --
          Matt Kruse
          Javascript Toolbox: http://www.JavascriptToolbox.com/


          Comment

          • Andrew Thompson

            #6
            Re: Detecting onmouseup outside browser window?

            On Mon, 5 Jul 2004 14:53:12 -0500, Matt Kruse wrote:
            [color=blue]
            > Andrew Thompson wrote:[color=green][color=darkred]
            >>> Walter Zorn has managed it. See here:
            >>> http://www.walterzorn.com/dragdrop/dragdrop_e.htm[/color]
            >> You assertion does not seem to be borne out
            >> by the way the code acts.[/color]
            >
            > On the contrary, it works for me.
            > If I resize my browser (IE6)[/color]

            Oops, my bad.. forgot to mention I tested in
            Moz 1.3.. (actually I did not even notice till
            you mentioned the page, I had both browsers
            open at the time..)

            Probably some IE security hole.. ;-)

            --
            Andrew Thompson
            http://www.PhySci.org/ Open-source software suite
            http://www.PhySci.org/codes/ Web & IT Help
            http://www.1point1C.org/ Science & Technology

            Comment

            • Randy Webb

              #7
              Re: Detecting onmouseup outside browser window?

              Mandy Memphis wrote:
              [color=blue]
              > "Randy Webb" <hikksnotathome @aol.com> wrote in message
              > news:8YednZ5qar lMHXTdRVn-jA@comcast.com. ..
              >[/color]

              <--snip-->
              [color=blue]
              > Hi Randy,
              >
              > Walter Zorn has managed it. See here:[/color]

              No, he has attempted to manage it. It fails, utterly, in Mozilla.
              I drug the cat down, let go of the mouse outside the window, and even
              while I am typing this, it is still attempting to scroll the cat down
              even more.
              [color=blue]
              > http://www.walterzorn.com/dragdrop/dragdrop_e.htm
              >
              > I just wish his code wasn't so cryptic![/color]

              When I see code like this:

              href="javascrip t:void(0)"

              I tend to stop reading anymore, as the author code such as that isn't
              very aware of reality on the web.


              --
              Randy
              Chance Favors The Prepared Mind
              comp.lang.javas cript FAQ - http://jibbering.com/faq/

              Comment

              • Andrew Thompson

                #8
                Re: Detecting onmouseup outside browser window?

                On Mon, 05 Jul 2004 19:27:08 -0400, Randy Webb wrote:
                [color=blue]
                > I drug the cat down, let go of the mouse outside the window,[/color]

                Isn't is safe to let the mouse go inside the
                window if the cat is drugged? Maybe not if
                it's speed or coke though. ;-)

                --
                Andrew Thompson
                http://www.PhySci.org/ Open-source software suite
                http://www.PhySci.org/codes/ Web & IT Help
                http://www.1point1C.org/ Science & Technology

                Comment

                • Mandy Memphis

                  #9
                  Re: Detecting onmouseup outside browser window?

                  "Randy Webb" <hikksnotathome @aol.com> wrote in message
                  news:59CdnZ2c4Y 9IfnTdRVn-hw@comcast.com. ..[color=blue]
                  > Mandy Memphis wrote:
                  >[color=green]
                  > > "Randy Webb" <hikksnotathome @aol.com> wrote in message
                  > > news:8YednZ5qar lMHXTdRVn-jA@comcast.com. ..
                  > >[/color]
                  >
                  > <--snip-->
                  >[color=green]
                  > > Hi Randy,
                  > >
                  > > Walter Zorn has managed it. See here:[/color]
                  >
                  > No, he has attempted to manage it. It fails, utterly, in Mozilla.
                  > I drug the cat down, let go of the mouse outside the window, and even
                  > while I am typing this, it is still attempting to scroll the cat down
                  > even more.
                  >[color=green]
                  > > http://www.walterzorn.com/dragdrop/dragdrop_e.htm
                  > >
                  > > I just wish his code wasn't so cryptic![/color]
                  >
                  > When I see code like this:
                  >
                  > href="javascrip t:void(0)"
                  >
                  > I tend to stop reading anymore, as the author code such as that isn't
                  > very aware of reality on the web.[/color]

                  He was aware enough to get something to work that you said couldn't be done!
                  ;-P


                  Comment

                  • Matt Kruse

                    #10
                    Re: Detecting onmouseup outside browser window?

                    Randy Webb wrote:[color=blue]
                    > When I see code like this:
                    > href="javascrip t:void(0)"
                    > I tend to stop reading anymore, as the author code such as that isn't
                    > very aware of reality on the web.[/color]

                    I don't think that's a fair statement.
                    Obviously, Mr. Zorn is not a newbie script kiddie, and to be so judgemental
                    of his abilities based on a snippet of code is a bit unwarranted, IMO.

                    --
                    Matt Kruse
                    Javascript Toolbox: http://www.JavascriptToolbox.com/


                    Comment

                    • Randy Webb

                      #11
                      Re: Detecting onmouseup outside browser window?

                      Mandy Memphis wrote:

                      <--snip-->
                      [color=blue][color=green]
                      >>
                      >>When I see code like this:
                      >>
                      >>href="javascr ipt:void(0)"
                      >>
                      >>I tend to stop reading anymore, as the author code such as that isn't
                      >>very aware of reality on the web.[/color]
                      >
                      >
                      > He was aware enough to get something to work that you said couldn't be done!
                      > ;-P[/color]

                      No, because it doesn't work.

                      --
                      Randy
                      Chance Favors The Prepared Mind
                      comp.lang.javas cript FAQ - http://jibbering.com/faq/

                      Comment

                      • Randy Webb

                        #12
                        Re: Detecting onmouseup outside browser window?

                        Matt Kruse wrote:
                        [color=blue]
                        > Randy Webb wrote:
                        >[color=green]
                        >>When I see code like this:
                        >>href="javascr ipt:void(0)"
                        >>I tend to stop reading anymore, as the author code such as that isn't
                        >>very aware of reality on the web.[/color]
                        >
                        >
                        > I don't think that's a fair statement.
                        > Obviously, Mr. Zorn is not a newbie script kiddie, and to be so judgemental
                        > of his abilities based on a snippet of code is a bit unwarranted, IMO.[/color]

                        No, he is not a newbie script kiddie, but I still tend to discount code
                        written that has snippets of that in it. I also tend to discount code
                        that has attempted obfuscation in it, and thats based on his .js file.


                        --
                        Randy
                        Chance Favors The Prepared Mind
                        comp.lang.javas cript FAQ - http://jibbering.com/faq/

                        Comment

                        • Mandy Memphis

                          #13
                          Re: Detecting onmouseup outside browser window?

                          "Randy Webb" <hikksnotathome @aol.com> wrote in message
                          news:7oOdnUY-AvUf4XfdRVn-sA@comcast.com. ..[color=blue]
                          > Mandy Memphis wrote:
                          >
                          > <--snip-->
                          >[color=green][color=darkred]
                          > >>
                          > >>When I see code like this:
                          > >>
                          > >>href="javascr ipt:void(0)"
                          > >>
                          > >>I tend to stop reading anymore, as the author code such as that isn't
                          > >>very aware of reality on the web.[/color]
                          > >
                          > >
                          > > He was aware enough to get something to work that you said couldn't be[/color][/color]
                          done![color=blue][color=green]
                          > > ;-P[/color]
                          >
                          > No, because it doesn't work.[/color]

                          Work for me.


                          Comment

                          • Andrew Thompson

                            #14
                            Re: Detecting onmouseup outside browser window?

                            On Tue, 6 Jul 2004 21:40:04 -0400, Mandy Memphis wrote:
                            [color=blue][color=green]
                            >> No, because it doesn't work.[/color]
                            >
                            > Work for me.[/color]

                            The natural assumption on this group is that you
                            are developing for the web unless otherwise stated.

                            On the web, it does not work. ( Note that you
                            have already had a 50% failure rate in the
                            4 tests conducted. )

                            --
                            Andrew Thompson
                            http://www.PhySci.org/ Open-source software suite
                            http://www.PhySci.org/codes/ Web & IT Help
                            http://www.1point1C.org/ Science & Technology

                            Comment

                            • Matt Kruse

                              #15
                              Re: Detecting onmouseup outside browser window?

                              Andrew Thompson wrote:[color=blue]
                              > The natural assumption on this group is that you
                              > are developing for the web unless otherwise stated.
                              > On the web, it does not work. ( Note that you
                              > have already had a 50% failure rate in the
                              > 4 tests conducted. )[/color]

                              It would be more correct to say that on the web, it does not work with all
                              browsers, but most likely does work for the majority of users. Also, it
                              appears to degrade gracefully (not causing any problems in browsers where it
                              doesn't work) which is exactly what we'd want.

                              So, in summary, it appears to be a fantastic solution, IMO.

                              --
                              Matt Kruse
                              Javascript Toolbox: http://www.JavascriptToolbox.com/


                              Comment

                              Working...