mousewheel
This page has been flagged with the following issues:
High-level issues:
Overview Table
| Synchronous | No |
|---|---|
| Bubbles | No |
| Target | dom/Element |
| Cancelable | No |
| Default action |
Examples
View live exampleThe following example shows how to use the onmousewheel event and the wheelDelta parameter to expand and contract a picture in response to the wheel button being moved.
<html>
<head>
<script type="text/javascript">
var count = 10;
function Picture()
{
if (event.wheelDelta >= 120)
Resize(++count);
else if (event.wheelDelta <= -120)
Resize(--count);
return false;
}
function Resize(c){
oImage.style.zoom = c + '0%';
}
</script>
</head>
<body>
<img id="oImage" src="Sample.png" alt="sample "onmousewheel="Picture()">
</body>
</html>
Notes
Remarks
The onmousewheel event is the only event that exposes the wheelDelta property. This property indicates the distance that the wheel button has rotated, expressed in multiples of 120. A positive value indicates that the wheel button has rotated away from the user. A negative value indicates that the wheel button has rotated toward the user. See the example below.
onmousewheel was introduced in Microsoft Internet Explorer 6
Scrolls the page up or down.
To invoke this event, do one of the following:
- Rotate the wheel button.
Syntax
Standards information
There are no standards that apply here.
Event handler parameters
- pEvtObj [in]
- Type: IHTMLEventObj
See also
Related pages (MSDN)
aabbracronymaddressappletareaaudiobbdobigblockQuotebodybuttoncanvascaptioncentercitecodecustomdddeldfndirdivdldocumentdtemembedfieldSetfontformhnhriimginput type=buttoninput type=checkboxinput type=fileinput type=imageinput type=passwordinput type=radioinput type=resetinput type=submitinput type=textinskbdlabellegendlilistingmapmarqueemenunoBRobjectolpplainTextpreqrtrubyssampselectsmallsourcespanstrikestrongsubsuptabletBodytdtextAreatFootthtHeadtrttuulvarvideowindowxmpReferenceonscrollonmousemoveonmousedownonmouseoutonmouseoveronmouseup
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]
This tool helps to make and review comments inline.
How to Use
insert instructions, with images, here