简体   繁体   English

HTML图像链接在android phonegap应用中无法正常工作

[英]HTML Image Link not working properly in android phonegap app

I am developing a FM Radio streaming app. 我正在开发FM广播流媒体应用程序。 When user presses in toggle button the streaming should stop when clicked again it should start. 当用户按下切换按钮时,流应停止,再次单击应开始。

streaming works fine but the portion where user needs to touch is not exactly coming on top of that toggle icon. 流媒体效果很好,但用户需要触摸的部分并没有完全位于该切换图标的顶部。 Its coming slightly some where on the top portion of the icon. 它略微位于图标顶部的某些位置。 The portion I have circled and shown in picture. 我圈出的部分如图所示。

How to create Image button with simple css and html for this case 在这种情况下,如何使用简单的CSS和HTML创建图像按钮

<a href="#"  style="position:fixed;top: 1%;left: 5%;" onclick="toggleAudio('http://kantipur-stream.softnep.com:7248');">
<img src="images/toggle.png">
</a>

在此处输入图片说明

I'd recommend using a touchststart, or touchend, event instead of click events, as they normally (except in VERY recent mobile Chrome browsers) have a delay. 我建议使用touchststart或touchend事件而不是click事件,因为它们通常会有所延迟(在非常新的移动Chrome浏览器中除外)。 Also, I'd get rid of the link. 此外,我会摆脱链接。 Just add the event handler to the image itself. 只需将事件处理程序添加到图像本身即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM