当一个窗口不是通过window.open或者window.showModalDialog打开的时候,调用JS的window.close() 谷歌浏览器会提示如下警告,并拒绝执行 Scripts may close only the windows that were opened by it. 解决方法:(此方法无效) function closeWindow(){ var browserName=navigator.appName; alert(browserName); if (browse
分享一个js实现判断鼠标滚轮的上下滚动: <script type="text/javascript"> var scrollFunc = function (e) { e = e || window.event; if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 if (e.wheelDelta > 0) { //当滑轮向上滚动时 alert("滑轮向上滚动"); } if (e.wheelDelta < 0) {
//加载顺序问题,不可改变位置 var scrollFunc = function(e){ e = e || window.event; if (e.wheelDelta) { if (e.wheelDelta > 0) { scrollUp(); } if (e.wheelDelta < 0) { scrollDown(); } }else if (e.detail) { //Firefox 滑轮事件 if (e.detail
JS 判断鼠标滚轮的上下滚动 <script type="text/javascript"> var scrollFunc = function (e) { e = e || window.event; if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 if (e.wheelDelta > 0) { //当滑轮向上滚动时 alert("滑轮向上滚动"); } if (e.wheelDelta < 0) { //当滑