wheelEvent = "onwheel" in document.createElement("div") ? "wheel" : // Modern browsers support "wheel" document.onmousewheel !== undefined ? "mousewheel" : // Webkit and IE support at least "mousewhee
Unity开发NGUI代码实现ScrollView(滚动视图) 下载NGUI包 导入NGUI3.9.1版本package 链接: http://pan.baidu.com/s/1mgksPBU 密码: bacy 导入NGUI包 创建MainCameraScript.cs脚本 MainCameraScript.cs using UnityEngine; using System.Collections; public class MainCameraScript : MonoBehaviour {
<script> var scrollFunc = function (e) { var direct = 0; e = e || window.event; if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 if (e.wheelDelta > 0) { //当滑轮向上滚动时 alert("滑轮向上滚动"); } if (e.wheelDelta < 0) { //当滑轮向下滚动时 alert("滑轮向下滚动");