[ka-Map-users] Mouse Wheel for Ka-Map
Ed Cooley
ecooley at strategy5.com
Wed Aug 31 11:59:06 EDT 2005
Here are some mouse wheel functions for zoom in and out if anyone is
interested. If you use it, please send me a link to your page.
Ed
Just add on onmousewheel to your ka-map viewport div like this:
<div id="viewport" onmousewheel="wheel();">
//-----------------------------------------------------
// Put this in your <HEAD><SCRIPT> section, it includes
// the handler and an initialization function for
// non-ie browsers
//-----------------------------------------------------
function wheel(e)
{
var wheelDelta;
if (!e)
e=window.event;
if (e.wheelDelta)
wheelDelta=e.wheelDelta;
else if (e.detail)
wheelDelta=e.detail*-1;
if (wheelDelta>0)
myZoomIn();
else if (wheelDelta<0)
myZoomOut();
}
if (window.addEventListener && navigator.product &&
navigator.product=="Gecko") {
document.addEventListener("DOMMouseScroll",wheel,false);
//----------------------------------------------------------
---
Edward J. Cooley
Strategy Systems, Inc.
479-271-7400 - Fax: 479-271-7401
ecooley at strategysystems.com
http://www.strategysystems.com/
More information about the ka-Map-users
mailing list