Events supported by Namo WebCanvas
The Scalable Vector Graphics (SVG) format, having been designed largely for use on the Web and viewing in Web browsers, supports the use of scripts in combination with events to provide a way for users to interact with SVG objects on Web pages. An event is something that happens with respect to an object; something that “triggers” an action (causes the browser to execute a script). For example, clicking an image can cause the browser to open a certain link in a new window. In this case, the act of clicking the image causes an onClick event to occur, triggering the action of opening a new window. Any object in an SVG file can have various events associated with it, each of which specifies a particular action (script). The following is a list of the events you can associate with an object in Namo WebCanvas.
Mouse events
Event |
Occurs When |
---|---|
onMouseDown |
The mouse button is pressed down (but not necessarily released) while the pointer is over the object |
onMouseUp |
The mouse button is released (whether or not it was pressed) while the pointer is over the object |
onClick |
The mouse button is both pressed and released while the pointer is over the object |
onMouseOver |
The mouse pointer enters the bounds of the object |
onMouseMove |
The mouse pointer is moved while it is within the bounds the object |
onMouseOut |
The mouse pointer exits the bounds of the object |
Keyboard events
Event |
Occurs When |
---|---|
onFocusIn |
The object receives keyboard focus |
onFocusOut |
The object loses keyboard focus |
onActivate |
An object having a hyperlink is “activated” (in this state, pressing Enter will cause the browser to follow the link) |
onKeyDown |
A key is pressed down while the object has keyboard focus |
onKeyPress |
A key is pressed and released while the object has keyboard focus |
onKeyUp |
A key is released while the object has keyboard focus |
Document and window events
Event |
Occurs When |
---|---|
onLoad |
The browser finishes loading the page |
onError |
The browser encounters an error while loading the page |
onAbort |
The user cancels loading the page while in progress |
onUnload |
The browser leaves the page |
onZoom |
The browser is zoomed in or out |
onResize |
The browser window is resized |
onScroll |
The browser window is scrolled |