安卓下点击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>
本文介绍了一种在安卓设备上解决点击A标签不跳转的方法,并通过使用div替代a标签来避免触发虚拟键盘弹出的问题。
3065

被折叠的 条评论
为什么被折叠?



