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

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

 

posted @ 2016-09-03 12:06  竹立荷塘  阅读(6616)  评论(0编辑  收藏  举报