[Project_owners] DOMMouseScroll differs in HTML and XUL

Didier Ernotte didier at ernotte.com
Mon Sep 25 09:25:40 EDT 2006


I need to capture the mouse wheel scroll event in my extension, and one user reports that it does not work with the trackpad. I have written a small sample file in HTML to see how it works and the same in XUL. It seems that the XUL implementation of the DOMMouseScroll does not capture the scroll from the trackpad. Does anybody knows how to capture the scroll from the trackpad ?
Thanks !




      <input type="text" id="box" value="move scroll wheel here">

document.getElementById("box").addEventListener("DOMMouseScroll", mouseScroll, false);

function mouseScroll(event)
  document.getElementById("box").value = event.detail;



<?xml version="1.0" encoding="utf-8"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"

<textbox id="box" value="move scroll wheel here"/>

<script type="application/x-javascript">
document.getElementById("box").addEventListener("DOMMouseScroll", mouseScroll, true);

function mouseScroll(event)
  document.getElementById("box").value = event.detail;



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20060925/f78ed853/attachment.htm

More information about the Project_owners mailing list