一.click等事件在移动端的延迟 click事件在移动端和pc端均可以触发,但是在移动端有延迟现象. 1.背景 由于早期移动设备浏览网页时内容较小,为了增强用户体验,苹果公司专门为移动设备设计了双击放大的功能,以确保用户可以方便地放大网页内容,但是当用户单击按钮的时候,移动设备需要延迟约300ms执行,以判断用户是否是要双击. 2.验证 下面通过js代码来直观地验证click等事件的延迟 <div class="result">点我试试</div> var s
function spinalCase(str) { // "It's such a fine line between stupid, and clever." // --David St. Hubbins str = str.replace(/_/g," ") .replace(/([A-Z])/g," $1") .replace(/^\s/,"") .replace(/\s+/g,"-") .toLo