給遮罩層的關(guān)閉按鈕綁定點(diǎn)擊事件卻無反應(yīng)。
<i class='i-close' ></i>
$("body").on("click",".i-close",function () {
$(".win").fadeOut();
})
原因:IOS只識(shí)別a標(biāo)簽,button按鈕之類的,對(duì)于i標(biāo)簽無效。
解決辦法:
對(duì)i標(biāo)簽添加cursor: pointer;
.i-close{cursor: pointer;}
或者綁定行內(nèi)事件
<i class='i-close' onclick="func()">
原文作者技術(shù)博客:http://www.itdecent.cn/u/ac4daaeecdfe