daipianpian

安卓下点击a标签不跳转的解决办法,是不用href做跳转的链接,改为用JS控制跳转

1 <a href="javascript:;" ontouchstart="window.location.href=\'https://www.baidu.com/\'"><img src="xxx"></a>

这样写虽然解决了安卓下点击a标签不跳转的问题,但还是没有解决点击a标签,在手机真机上会调出手机键盘的行为

 

不过将a标签换成div,就可以做到在手机真机上不会再调出手机键盘了

<div ontouchstart="window.location.href=\'http://https://www.baidu.com/\'"><img src="xxx"></div>

 

分类:

技术点:

相关文章: