產品的h5頁面幾乎都使用了iscroll插件,若是a標籤在iscroll裏,在部分手機瀏覽器中會出現沒法點擊的狀況,無論是綁定click事件仍是使用a標籤的href屬性。href屬性偶爾還會能點擊,click事件徹底不能。瀏覽器
若是用button或input代替a,都能響應click事件。微信
若是用微信內置瀏覽器,都能響應click事件(nubia除外)。QQ瀏覽器也能響應。app
也就是出現此問題跟手機本地瀏覽器,iscroll,a標籤都有關係。less
iScroll uses various techniques to scroll based on device/browser capability. Normally you don't need to configure the engine, iScroll is smart enough to pick the best for you.ide
Nonetheless it is important to understand which mechanisms iScroll works on and how to configure them.this
這裏說一般狀況下你不須要額外配置iscroll,由於iscroll能默認選擇最佳配置。spa
options太多,直接看重點,click和tap插件
To override the native scrolling iScroll has to inhibit some default browser behaviors, such as mouse clicks. If you want your application to respond to the click event you have to explicitly set this option to true
. Please note that it is suggested to use the custom tap
event instead (see below).code
緣由就是這兒了,iscroll阻止了瀏覽器默認的行爲,好比click。若是設置click爲true,原來不能點擊的手機能點擊了,可是原來能點擊的手機變成了雙擊,也就是將手機自己的click和iscroll的click各執行了一次。orm
若是隻設置click爲true,會出現部分a仍是沒法點擊,再加上taps:true;