简体   繁体   English

Android浏览器按钮单击问题

[英]Android Browser Button Click Issue

I have been trying to research this problem all day and have come up with nothing so far so I apologize if I am making a duplicate post. 我整天都在尝试研究此问题,但到目前为止却一无所获,因此,如果我发帖重复,我深表歉意。 I am a little unsure of how exactly to word the problem for search engines. 我不太确定如何准确表达搜索引擎的问题。

My problem is: I am working on a website that's mobile devices. 我的问题是:我正在移动设备的网站上工作。 In the website there are buttons that when clicked highlight a certain colour while it's loading the new page. 在网站上,有一些按钮,当单击它们时,将在加载新页面时突出显示某种颜色。 I do this with both links (styled to look like buttons) and buttons (html tag buttons). 我通过链接(样式看起来像按钮)和按钮(html标记按钮)来完成此操作。 I simply add a css class to the button/link using JavaScript that sets the background colour to the button. 我只是使用将背景颜色设置为按钮的JavaScript将CSS类添加到按钮/链接。 Now this works on Chrome on and all iOS devices. 现在,此功能可在Chrome和所有iOS设备上使用。

The problem arises on Android devices. 该问题出现在Android设备上。 All "link buttons" work fine but html tag buttons do not highlight. 所有“链接按钮”都可以正常工作,但html标记按钮不会突出显示。 For some reason, there are two that actually work but none others will. 出于某种原因,有两个实际可行,但没人能。 From what I understand, the Android browser will start loading the new content without refreshing the current page with the new css. 据我了解,Android浏览器将开始加载新内容,而不会使用新的CSS刷新当前页面。 This makes the page look frozen while it loads and stops any highlights from happening. 这使页面在加载和停止任何突出显示时看起来都冻结了。 This also effects a loading effect I bring up after clicking a certain button. 这也会影响我单击某个按钮后显示的加载效果。

I'm looking for any information anyone might have on this problem or any way I can search for a solution. 我正在寻找任何人可能对此问题有任何信息,或者我可以以任何方式搜索解决方案。 I've been trying to come up with creative solutions to get around the problem or find out why two buttons are highlighting and the others are not but it has been a long road. 我一直在尝试提出创造性的解决方案来解决问题,或者找出为什么两个按钮突出显示,而其他两个按钮没有突出显示,但是这是一条漫长的道路。 Any help would be much appreciated. 任何帮助将非常感激。

Thanks, 谢谢,

Kyle 凯尔

尝试

webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);

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

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