安卓下点击a标签不跳转;点击a标签在手机真机上会调出手机键盘的解决办法

时间:2016-09-03 13:39:15   收藏:0   阅读:1159

安卓下点击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>

 

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!