Loading ...
Sorry, an error occurred while loading the content.

mousewheel event

Expand Messages
  • jack2wsx
    I have used the scrollBars.js script and I am trying to update it to work with the mousewheel but it seems to ignore the event listener. Here is the code I :
    Message 1 of 15 , Jul 30, 2006
    • 0 Attachment
      I have used the scrollBars.js script and I am trying to update it to
      work with the mousewheel but it seems to ignore the event listener.
      Here is the code I :

      sbMake()
      sbSync()
      var re = document.rootElement
      re.addEventListener( "SVGScroll", sbSync, false )
      re.addEventListener( "SVGResize", sbSync, false )
      re.addEventListener( "SVGZoom", sbSync, false )
      re.addEventListener( "mousewheel", sbStartDragVS, false)

      The sbStartDragVS function begins with an alert("mousewheel!!") but
      the message never appears. I have tried variations with no success:

      re.addEventListener( "wheel", sbStartDragVS, false)
      and
      sbSliderV.g.addEventListener( "mousewheel", sbStartDragVS, false )

      Any ideas please help?
    • Bjoern Hoehrmann
      ... That is probably because it does not support the, as it stands, non- standard mousewheel event or does not dispatch it the way you think it should. --
      Message 2 of 15 , Jul 30, 2006
      • 0 Attachment
        * jack2wsx wrote:
        >I have used the scrollBars.js script and I am trying to update it to
        >work with the mousewheel but it seems to ignore the event listener.
        >Here is the code I :
        >
        >sbMake()
        >sbSync()
        >var re = document.rootElement
        >re.addEventListener( "SVGScroll", sbSync, false )
        >re.addEventListener( "SVGResize", sbSync, false )
        >re.addEventListener( "SVGZoom", sbSync, false )
        >re.addEventListener( "mousewheel", sbStartDragVS, false)
        >
        >The sbStartDragVS function begins with an alert("mousewheel!!") but
        >the message never appears. I have tried variations with no success:

        That is probably because "it" does not support the, as it stands, non-
        standard "mousewheel" event or does not dispatch it the way you think
        it should.
        --
        Björn Höhrmann · mailto:bjoern@... · http://bjoern.hoehrmann.de
        Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
        68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
      • Holger Will
        Hi Jack in firefox the following works for me : addEventListener( DOMMouseScroll ,func,false) hth Holger -- if this information was useful, please try to help
        Message 3 of 15 , Jul 30, 2006
        • 0 Attachment
          Hi Jack

          in firefox the following works for me :

          addEventListener("DOMMouseScroll",func,false)

          hth
          Holger

          --
          if this information was useful, please try to help someone else !
          My Private Homepage: http://www.treebuilder.de
          My Companys Website: http://www.klimapartner-berlin.de
        • meikelneu
          ... well this works for me too as far as firing an event goes but how about something like wheelDelta or clientY ? Michael
          Message 4 of 15 , Jul 31, 2006
          • 0 Attachment
            --- In svg-developers@yahoogroups.com, Holger Will <holger@...> wrote:

            > in firefox the following works for me :
            >
            > addEventListener("DOMMouseScroll",func,false)

            well this works for me too as far as firing an event goes
            but how about something like "wheelDelta" or clientY ?

            Michael
          • Holger Will
            hi Michael, ... in mozilla its evt.detail , but dont ask me about the values returned. the only thing i know is if you scroll up its a positive value, if you
            Message 5 of 15 , Jul 31, 2006
            • 0 Attachment
              hi Michael,

              >> well this works for me too as far as firing an event goes
              >> but how about something like "wheelDelta" or clientY ?

              in mozilla its evt.detail , but dont ask me about the values returned.
              the only thing i know is if you scroll up its a positive value, if you
              scroll down its negative.

              hth
              Holger
            • Haritos, James
              Hi guys, Thanks for your help. I need to get it working in IE though - I tried addeventlistener( DOMMouseScroll ) and SVGMousewheel but it does not work
              Message 6 of 15 , Jul 31, 2006
              • 0 Attachment
                Hi guys,
                Thanks for your help. I need to get it working in IE though - I tried
                addeventlistener("DOMMouseScroll") and "SVGMousewheel" but it does not work
                either. I have also tried:

                document.rootElement.onmousewheel = "sbStartDragVS()"
                and
                window.onmousewheel = "sbStartDragVS()"
                and
                document.onmousewheel = "sbStartDragVS()"

                Although no error is produced, all of these do nothing. These ideas come
                from
                here : http://comments.gmane.org/gmane.text.xml.svg.devel/3142
                <http://comments.gmane.org/gmane.text.xml.svg.devel/3142>
                and here http://adomas.org/javascript-mouse-wheel/
                <http://adomas.org/javascript-mouse-wheel/>

                they are interesting web pages but can't get it to work. Another suggestion
                is:

                <svg xmlns="http://www.w3.org/2000/svg <http://www.w3.org/2000/svg> "
                xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/
                <http://schemas.microsoft.com/visio/2003/SVGExtensions/> " width="1000"
                height="850" viewBox="0 0 1000 850" xml:space="preserve"
                color-interpolation-filters="sRGB" class="st23" onmousewheel="alert('hi')">

                ...but also does not work although works in HTML like this: <body
                onmousewheel="alert('hi')">

                The mouse wheel is also discussed on the w3 website:
                http://www.w3.org/TR/2005/WD-SVGMobile12-20050413/svgudom.html#events::Wheel
                Event
                <http://www.w3.org/TR/2005/WD-SVGMobile12-20050413/svgudom.html#events::Whee
                lEvent>
                also here
                http://www.w3.org/TR/SVGMobile12/svgudom.html#events__WheelEvent
                <http://www.w3.org/TR/SVGMobile12/svgudom.html#events__WheelEvent>

                Are these referring to future enhancements or are they current? Dunno but I
                couldn't get the suggestions there working either.

                OR Is there a catch all mouse event handler that I could parse for the wheel
                action?

                Ahhh what should be a simple and standard function is turning out to be very
                mysterious! :-<


                -----Original Message-----
                From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
                On Behalf Of Holger Will
                Sent: Tuesday, 01 August 2006 1:03 AM
                To: svg-developers@yahoogroups.com
                Subject: Re: [svg-developers] Re: mousewheel event



                hi Michael,

                >> well this works for me too as far as firing an event goes
                >> but how about something like "wheelDelta" or clientY ?

                in mozilla its evt.detail , but dont ask me about the values returned.
                the only thing i know is if you scroll up its a positive value, if you
                scroll down its negative.

                hth
                Holger






                Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website.

                The information contained in this e-mail communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee the integrity of this e-mail communication has been maintained nor that the communication is free of errors, virus or interference.

                If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this e-mail communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so.

                [Non-text portions of this message have been removed]
              • Lance Dyas
                ... Do you have a page with the non working code... This page... created with TNTmap http://www.microimages.com/ogc/maps/topo.htm has working mousewheel
                Message 7 of 15 , Jul 31, 2006
                • 0 Attachment
                  Haritos, James wrote:
                  > Hi guys,
                  > Thanks for your help. I need to get it working in IE though - I tried
                  > addeventlistener("DOMMouseScroll") and "SVGMousewheel" but it does not work
                  > either. I have also tried:
                  >
                  Do you have a page with the non working code...
                  This page... created with TNTmap
                  http://www.microimages.com/ogc/maps/topo.htm
                  has working mousewheel support

                  Lance Dyas
                  http://www.microimages.com/tntmap
                • Lance Dyas
                  ... Woops wrong mailing list.. I thought I was reading my google maps list.... dang.
                  Message 8 of 15 , Jul 31, 2006
                  • 0 Attachment
                    Lance Dyas wrote:
                    > Haritos, James wrote:
                    >
                    >> Hi guys,
                    >> Thanks for your help. I need to get it working in IE though - I tried
                    >> addeventlistener("DOMMouseScroll") and "SVGMousewheel" but it does not work
                    >> either. I have also tried:
                    >>
                    >>
                    > Do you have a page with the non working code...
                    > This page... created with TNTmap
                    > http://www.microimages.com/ogc/maps/topo.htm
                    > has working mousewheel support
                    >
                    > Lance Dyas
                    > http://www.microimages.com/tntmap
                    >
                    >
                    Woops wrong mailing list..
                    I thought I was reading my google maps list....
                    dang.
                    > .
                    >
                    >
                  • Haritos, James
                    Hi Lance, Is that an SVG on that site? ... From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com] On Behalf Of Lance Dyas Sent: Tuesday,
                    Message 9 of 15 , Jul 31, 2006
                    • 0 Attachment
                      Hi Lance,
                      Is that an SVG on that site?

                      -----Original Message-----
                      From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
                      On Behalf Of Lance Dyas
                      Sent: Tuesday, 01 August 2006 1:05 PM
                      To: svg-developers@yahoogroups.com
                      Subject: Re: [svg-developers] Re: mousewheel event



                      Lance Dyas wrote:
                      > Haritos, James wrote:
                      >
                      >> Hi guys,
                      >> Thanks for your help. I need to get it working in IE though - I tried
                      >> addeventlistener("DOMMouseScroll") and "SVGMousewheel" but it does not
                      work
                      >> either. I have also tried:
                      >>
                      >>
                      > Do you have a page with the non working code...
                      > This page... created with TNTmap
                      > http://www.microima <http://www.microimages.com/ogc/maps/topo.htm>
                      ges.com/ogc/maps/topo.htm
                      > has working mousewheel support
                      >
                      > Lance Dyas
                      > http://www.microima <http://www.microimages.com/tntmap> ges.com/tntmap
                      >
                      >
                      Woops wrong mailing list..
                      I thought I was reading my google maps list....
                      dang.
                      > .
                      >
                      >







                      Australia Post is committed to providing our customers with excellent service. If we can assist you in any way please telephone 13 13 18 or visit our website.

                      The information contained in this e-mail communication may be proprietary, confidential or legally professionally privileged. It is intended exclusively for the individual or entity to which it is addressed. You should only read, disclose, re-transmit, copy, distribute, act in reliance on or commercialise the information if you are authorised to do so. Australia Post does not represent, warrant or guarantee the integrity of this e-mail communication has been maintained nor that the communication is free of errors, virus or interference.

                      If you are not the addressee or intended recipient please notify us by replying direct to the sender and then destroy any electronic or paper copy of this message. Any views expressed in this e-mail communication are taken to be those of the individual sender, except where the sender specifically attributes those views to Australia Post and is authorised to do so.

                      [Non-text portions of this message have been removed]
                    • Jonathan Chetwynd
                      James, It s probably unlikely that mousewheel will work with ASV until there is a new release, or hence IE. It s amazing there is any support in ff, given that
                      Message 10 of 15 , Jul 31, 2006
                      • 0 Attachment
                        James,

                        It's probably unlikely that mousewheel will work with ASV until there
                        is a new release, or hence IE.

                        It's amazing there is any support in ff, given that mousewheel is not
                        part of SVG1.1

                        regards

                        Jonathan Chetwynd
                      • meikelneu
                        ... Thanks, Holger, I really couldn t find this even after a significant amount of googling. There seems to be some discussion with regard to DOM3 about
                        Message 11 of 15 , Aug 1, 2006
                        • 0 Attachment
                          --- In svg-developers@yahoogroups.com, Holger Will <holger@...> wrote:
                          >
                          > in mozilla its evt.detail , but dont ask me about the values returned.
                          > the only thing i know is if you scroll up its a positive value, if you
                          > scroll down its negative.

                          Thanks, Holger, I really couldn't find this even after a significant
                          amount of googling. There seems to be some discussion with regard to
                          DOM3 about wheelDelta

                          as for the values returned it seems to be device dependent:

                          using a Microsoft Mouse on WinXP I got the value 3 for each increment
                          of the mousewheel (the Microsoft wheel has notches) and it turns out
                          that in the Mouse Control Panel (System Preferences) the wheel
                          settings were to "move 3 lines per increment". And indeed, changing
                          this value was identically reflected in "evt.detail"

                          Using an Apple Trackpad with scroll functionality (two fingers at
                          once) resulted in different values but always integers. I expect
                          similar results with devices like the Apple Mighty Mouse that doesn't
                          have increments/ notches.

                          Michael
                        • Holger Will
                          ... Hi Michael ... thanks a lot, thats some useful information there. i cant wait to see this specified, and usable in more browsers. cheers Holger -- if this
                          Message 12 of 15 , Aug 1, 2006
                          • 0 Attachment
                            >

                            Hi Michael

                            >>using a Microsoft Mouse on WinXP I got the value 3 for each increment
                            >>of the mousewheel (the Microsoft wheel has notches) and it turns out
                            >>that in the Mouse Control Panel (System Preferences) the wheel
                            >>settings were to "move 3 lines per increment". And indeed, changing
                            >>this value was identically reflected in "evt.detail"

                            thanks a lot, thats some useful information there. i cant wait to see
                            this specified, and
                            usable in more browsers.

                            cheers
                            Holger

                            --
                            if this information was useful, please try to help someone else !
                            My Private Homepage: http://www.treebuilder.de
                            My Companys Website: http://www.klimapartner-berlin.de
                          • xof
                            Hi, Here is a working example of using the mousewheel event in IE + ASV6 (can’t remember if it works in ASV3). The svg file is called from an embed element
                            Message 13 of 15 , Aug 1, 2006
                            • 0 Attachment
                              Hi,

                              Here is a working example of using the mousewheel event in IE + ASV6 (can’t
                              remember if it works in ASV3). The svg file is called from an embed element
                              and this may not be what you need.

                              http://www.geoloc.org/app/CITYFINDER/

                              An onmousewheel attribute is placed in the embed element:

                              <embed onmousewheel="myMapController.doOnMouseWheel()" type="image/svg+xml"
                              src="map.svg" ...></embed


                              In myMapController:

                              this.doOnMouseWheel = function(){
                              if (event.wheelDelta >= 120){
                              this.playZoomSound('-');
                              if(this.vbM) this.vbM.zoomOut();
                              }else if (event.wheelDelta <= -120){
                              this.playZoomSound('+');
                              if(this.vbM) this.vbM.zoomIn();
                              }
                              }

                              From where comes this magic number 120 ?
                              I can't remember, the code almost 3 years old, but it seems to work fine.


                              Cheers

                              Christophe

                              ________________________________________
                              From: svg-developers@yahoogroups.com [mailto:svg-developers@yahoogroups.com]
                              On Behalf Of Holger Will
                              Sent: mardi 1 août 2006 17:21
                              To: svg-developers@yahoogroups.com
                              Subject: Re: [svg-developers] Re: mousewheel event

                              >

                              Hi Michael

                              >>using a Microsoft Mouse on WinXP I got the value 3 for each increment
                              >>of the mousewheel (the Microsoft wheel has notches) and it turns out
                              >>that in the Mouse Control Panel (System Preferences) the wheel
                              >>settings were to "move 3 lines per increment". And indeed, changing
                              >>this value was identically reflected in "evt.detail"

                              thanks a lot, thats some useful information there. i cant wait to see
                              this specified, and
                              usable in more browsers.

                              cheers
                              Holger
                            • Doug Schepers
                              Hi, Holger- ... Mousewheel events are specified in the latest draft of the SVG Tiny 1.2 spec (which will hopefully be a Candidate Recommendation soon). There
                              Message 14 of 15 , Aug 1, 2006
                              • 0 Attachment
                                Hi, Holger-

                                Holger Will wrote:
                                |
                                | i cant wait to see this specified, and usable in more browsers.

                                Mousewheel events are specified in the latest draft of the SVG Tiny 1.2 spec
                                (which will hopefully be a Candidate Recommendation soon). There is also
                                work on them for the WebAPI Working Group's DOM3 specification, and if they
                                meet the needs of SVG, the SVG spec will drop them in favor of the more
                                language-neutral DOM3 version.

                                So no matter what, there will be a specified mousewheel event soon, and I
                                imagine that most browsers will support it.

                                Regards-
                                Doug
                              • meikelneu
                                Yep, this one works with ASV3 and ie6 The question is: For how long? Since the Eolas patent thing ie6 is soon to change the way it handles plugin content via
                                Message 15 of 15 , Aug 2, 2006
                                • 0 Attachment
                                  Yep, this one works with ASV3 and ie6

                                  The question is: For how long?

                                  Since the Eolas patent thing ie6 is soon to change the way it handles
                                  plugin content via the embed tag ...


                                  --- In svg-developers@yahoogroups.com, "xof" <xofm1@...> wrote:
                                  >
                                  > Hi,
                                  >
                                  > Here is a working example of using the mousewheel event in IE + ASV6
                                  (can�t
                                  > remember if it works in ASV3). The svg file is called from an embed
                                  element
                                  > and this may not be what you need.
                                  >
                                  > http://www.geoloc.org/app/CITYFINDER/
                                  >
                                  > An onmousewheel attribute is placed in the embed element:
                                  >
                                  > <embed onmousewheel="myMapController.doOnMouseWheel()"
                                  type="image/svg+xml"
                                  > src="map.svg" ...></embed
                                  >
                                  >
                                  > In myMapController:
                                  >
                                  > this.doOnMouseWheel = function(){
                                  > if (event.wheelDelta >= 120){
                                  > this.playZoomSound('-');
                                  > if(this.vbM) this.vbM.zoomOut();
                                  > }else if (event.wheelDelta <= -120){
                                  > this.playZoomSound('+');
                                  > if(this.vbM) this.vbM.zoomIn();
                                  > }
                                  > }
                                  >
                                  > From where comes this magic number 120 ?
                                  > I can't remember, the code almost 3 years old, but it seems to work
                                  fine.
                                  >
                                  >
                                  > Cheers
                                  >
                                  > Christophe
                                  >
                                  > ________________________________________
                                  > From: svg-developers@yahoogroups.com
                                  [mailto:svg-developers@yahoogroups.com]
                                  > On Behalf Of Holger Will
                                  > Sent: mardi 1 ao�t 2006 17:21
                                  > To: svg-developers@yahoogroups.com
                                  > Subject: Re: [svg-developers] Re: mousewheel event
                                  >
                                  > >
                                  >
                                  > Hi Michael
                                  >
                                  > >>using a Microsoft Mouse on WinXP I got the value 3 for each increment
                                  > >>of the mousewheel (the Microsoft wheel has notches) and it turns out
                                  > >>that in the Mouse Control Panel (System Preferences) the wheel
                                  > >>settings were to "move 3 lines per increment". And indeed, changing
                                  > >>this value was identically reflected in "evt.detail"
                                  >
                                  > thanks a lot, thats some useful information there. i cant wait to see
                                  > this specified, and
                                  > usable in more browsers.
                                  >
                                  > cheers
                                  > Holger
                                  >
                                Your message has been successfully submitted and would be delivered to recipients shortly.