Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Is it possible to have JavaScript triggered by Mouse Scroll Button?

    I had an idea for making a page that would react to the use of a mouse's scroll button. I've seen it done in flash, but is it possible to do it in JavaScript? Does anyone know?

    Brett Bretterson

  • #2
    New Coder
    Join Date
    Aug 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    My idea was to have a really big picture that by using the scroll button it would zoom in. That's what the Flash one I saw did, but instead of just having it be a cool picture I was thinking it would be a good system for looking at a map. That way you wouldn't have to click on a button to zoom in.

    Brett Bretterson

  • #3
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Hmm, there's no direct javascript handler for mouse scroll wheel scrolling, but if you were really clever you'd probably focus on an iframe or such with no borders or scrollbars and use that to set the javascript variables using the internal frame page scroll coordinates =)

    Just an idea

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #4
    Regular Coder
    Join Date
    Nov 2003
    Location
    Vancouver Island Canada
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts
    For IE you can use onMouseWheel. check this link. http://msdn.microsoft.com/library/de...mousewheel.asp

  • #5
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Nice one

    Great shout, forgot about that.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #6
    New Coder
    Join Date
    Aug 2005
    Posts
    46
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot guys. I'll incorporate that. Since it only works in IE (curse you IE, Curse you!!!) I'm going to make it so holding the right mouse button and moving up and down controls the zoom, but I can make it so it checks if it's IE then also does the scroller if it is.

    Anyway, thanks a lot.

    Brett Bretterson


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •