This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreScript Title: mouse
Programming Language: Java Script
Date Completed: 2013/06/05
Purpose: Provides an easy to use API for working with mouse events and functions in a Web page.
Description: Mouse API for working with mouse events and functions. Includes cross browser compatibility with unified features.
Compatibility: Works with all modern Web browsers, some legacy support.
Special Compatibility Notes:
Opera 9 and over is supported.
Opera may have detect right click and context menu disabled by default.
Webkits 412 and under only supports left click detection.
Methods:
Properties
mouse.position.x
Returns a number value measured in pixels, returns the mouse’s X position.mouse.position.y
Returns a number value measured in pixels, returns the mouse’s Y position.mouse.position.inner.x
Returns a number value measured in pixels, returns the mouse’s X position, within an element.mouse.position.inner.y
Returns a number value measured in pixels, returns the mouse’s Y position, within an element.mouse.disable.contextMenu
Set or returns true or false, set to disable the mouse’s context menu, default value false.mouse.disable.ctrlClick
Set or returns true of false, set to disable the ctrl+click command, default value false.mouse.disable.shiftClick
Set or returns true or false, set to disable the shift+click command, default value false.mouse.disable.altClick
Set or returns true or false, set to disable the alt+click command, default value false.mouse.disable.cmdClick
Set or returns true or false, set to disable the cmd+click command, default value false.
Apple computer exclusive.
mouse.disable.scroll
Set or returns true or false, set to disable the mouse’s scroll wheel, prevents the scrolling action, default value false.mouse.wheel
Returns a number value, returns the mouse wheel rotation value.mouse.target.over
Returns an element, returns the HTML element the mouse is currently Hovered over.mouse.target.down
Returns an element, returns the HTML element the mouse is currently hold down on.mouse.isActive
Returns true or false, returns true if the mouse API is active.mouse.isContextMenu
Returns true or false, returns true if the context menu event has fired, value resets to false after 1 second after the event.Functions
mouse.target.setInner()
Function to target an HTML element to listen for the inner mouse position.mouse.target.clearInner()
Function to remove set inner target element.mouse.isDown( button_s )
Function returns true or false, determines if the mouse is held down.mouse.isUp( button_s )
Function returns true or false, determines if the mouse is up.mouse.start()
Function to start the mouse API.mouse.stop()
Function to stop the mouse API.
isDown and isUp Arguments:
left
middle
right
ctrl
shift
alt
cmd
Note: Arguments are not case sensitize.
Note: (ctrl, shift, alt, cmd) event is fired when the key is held down while the mouse is up or down
Terms of Use, Cookies, Privacy, and more, see Terms and Privacy
Third-party copyrights and trademarks featured on this site are owned by their respected holders.
Website written and designed by Patcoola 2019, some rights reserved.
This blog uses responsible cookies for functionality and user preferences.
Google Analytics is used for collecting general public information to understand how my blog is used.
Learn moreDear EU visitor, I am required to ask you consent for the following.