xuyunhe
路人甲
路人甲
  • 注册日期2003-08-25
  • 发帖数59
  • QQ
  • 铜币374枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:2127回复:3

JSP+ArcIMS能不能实现用鼠标滚轮来放大缩小的呀?

楼主#
更多 发布于:2007-07-17 16:11
JSP+ArcIMS能不能实现用鼠标滚轮来放大缩小的呀?<BR>
喜欢0 评分0
xuyunhe
路人甲
路人甲
  • 注册日期2003-08-25
  • 发帖数59
  • QQ
  • 铜币374枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2007-07-19 15:21
谢谢了,正在试,有问题再联系你。
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
2楼#
发布于:2007-07-17 20:31
<P>脚本的原始来源:http://adomas.org/javascript-mouse-wheel/</P>
<P>我这里可以打开<br></P>
[此贴子已经被作者于2007-7-17 20:32:52编辑过]
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
gis
gis
管理员
管理员
  • 注册日期2003-07-16
  • 发帖数15951
  • QQ
  • 铜币25345枚
  • 威望15368点
  • 贡献值0点
  • 银元0个
  • GIS帝国居民
  • 帝国沙发管家
  • GIS帝国明星
  • GIS帝国铁杆
3楼#
发布于:2007-07-17 20:30
<P><br>Adds mouse wheel support to the HTML viewer in 9.2 ArcIMS - no reason why it should not work in others as it call the existing zoomin() and zoomout() functions. </P>
<P>The original script I used at http://adomas.org/javascript-mouse-wheel/ <br>claims to work in IE, Mozilla, Firefox, Opera. I have tested in in Firefox 2 and IE 6. </P>
<P>The wheel action zooms in by the preset zoom level around where the mouse pointer is NOT the centre of the map </P>
<P>Add to the end of aimsClick.js </P>
<P>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++</P>
<P><br>//ACM Wheel Mouse function<br>//Code originall from http://adomas.org/javascript-mouse-wheel/</P>
<P><br>function handle(delta) {<br>  <br>  <br>  <br>        if (delta < 0)<br>  zoomout();<br>        else<br>  zoomin();<br>}</P>
<P>/** Event handler for mouse wheel event.<br>*/<br>function wheel(event){<br>        var delta = 0;<br>        if (!event) /* For IE. */<br>                event = window.event;<br>        if (event.wheelDelta) { /* IE/Opera. */<br>                delta = event.wheelDelta/120;<br>                /** In Opera 9, delta differs in sign as compared to IE.<br>                 */<br>                if (window.opera)<br>                        delta = -delta;<br>        } else if (event.detail) { /** Mozilla case. */<br>                /** In Mozilla, sign of delta is different than in IE.<br>                 * Also, delta is multiple of 3.<br>                 */<br>                delta = -event.detail/3;<br>        }<br>        /** If delta is nonzero, handle it.<br>         * Basically, delta is now positive if wheel was scrolled up,<br>         * and negative, if wheel was scrolled down.<br>         */<br>        if (delta)<br>                handle(delta);<br>        /** Prevent default actions caused by mouse wheel.<br>         * That might be ugly, but we handle scrolls somehow<br>         * anyway, so don't bother here..<br>         */<br>        if (event.preventDefault)<br>                event.preventDefault();<br>event.returnValue = false;<br>}</P>
<P>/** Initialization code. <br>* If you use your own event management code, change it as required.<br>*/<br>if (window.addEventListener)<br>        /** DOMMouseScroll is for mozilla. */<br>        window.addEventListener('DOMMouseScroll', wheel, false);<br>/** IE/Opera. */<br>window.onmousewheel = document.onmousewheel = wheel;</P>
<P><br>//end ACM</P>
<P><br>  <br>  </P>
[此贴子已经被作者于2007-7-17 20:30:37编辑过]
GIS麦田守望者,期待与您交流。
举报 回复(0) 喜欢(0)     评分
游客

返回顶部