页面离开时的confirm提示
window.onbeforeunload = function() { return ‘你确认要离开吗?‘; };
页面加载完成的事件(在onload之后调用)
document.onreadystatechange = function() { if(document.readyState==‘complete‘) { } }
触摸事件
function load (){ document.addEventListener(‘touchstart‘,touch, false); document.addEventListener(‘touchmove‘,touch, false); document.addEventListener(‘touchend‘,touch, false); function touch (event){ var event = event || window.event; var oInp = document.getElementById("inp"); switch(event.type){ case "touchstart": oInp.innerHTML = "Touch started (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")"; break; case "touchend": oInp.innerHTML = " Touch end (" + event.changedTouches[0].clientX + "," + event.changedTouches[0].clientY + ")"; break; case "touchmove": event.preventDefault(); oInp.innerHTML = " Touch moved (" + event.touches[0].clientX + "," + event.touches[0].clientY + ")"; break; } } } window.addEventListener(‘load‘,load, false);
html5滚轮控件 http://www.17sucai.com/pins/7750.html
时间: 2024-11-05 09:28:37