Android Webview按钮不工作
Android Webview buttons not working
我正在制作一个html应用程序,并在Android的webview中运行它。在我的三星s3 mini和我测试过的其他几个设备上,一切都像预期的那样完美,但是按键在其他一些设备上没有效果(例如htc wildfire…我正在查找哪些设备不能工作)。
按钮的css格式为:
button {
-moz-box-shadow:inset 0px 1px 10px 0px #000000;
-webkit-box-shadow:inset 0px 1px 10px 0px #000000;
box-shadow:inset 0px 1px 10px 0px #000000;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #00ff00), color-stop(1, #00ff00) );
background:-moz-linear-gradient( center top, #00ff00 5%, #00ff00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ff00');
background-color:#00ff00;
-webkit-border-top-left-radius:42px;
-moz-border-radius-topleft:42px;
border-top-left-radius:42px;
-webkit-border-top-right-radius:42px;
-moz-border-radius-topright:42px;
border-top-right-radius:42px;
-webkit-border-bottom-right-radius:42px;
-moz-border-radius-bottomright:42px;
border-bottom-right-radius:42px;
-webkit-border-bottom-left-radius:42px;
-moz-border-radius-bottomleft:42px;
border-bottom-left-radius:42px;
text-indent:0px;
border:1px solid #006400;
display:inline-block;
color:#000000;
font-family:Arial;
font-size:1.2em;
font-weight:bold;
font-style:normal;
line-height:46px;
text-decoration:none;
text-align:center;
text-shadow:1px 1px 0px #00ff00;
width:7em;
}
button:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #00ff00), color-stop(1, #00ff00) );
background:-moz-linear-gradient( center top, #00ff00 5%, #00ff00 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ff00');
background-color:#00ff00;
}
button:active {
position:relative;
top:1px;
}
,其中一个按钮有:
.button-wrap {
width:auto;
}
有趣的是,带有class="button-wrap"
的按钮是唯一在一个设备上工作的按钮。
按钮的HTML很简单:
<button class="button-list-spacing" id="play-game-button">Play!</button>
和它们后面的js是:
$("#play-game-button").click(function (e) {
window.location.replace("gamepage.html?soundon=" + SOUND_ON);
});
有没有人知道什么东西会导致按钮不响应点击?我将来会编辑一个列表,列出它可以工作的设备,以及它不能工作的设备。
编辑:按钮不工作*三星galaxy tab 7.0 GT-P6200, Android版本3.2
这里是小提琴:http://jsfiddle.net/Yuy7F/
我在这里贴了一个相关的问题,可能值得一看:https://stackoverflow.com/questions/22595810/android-webview-messes-up-in-4-1-1-but-not-4-1-2
显然你正在使用像jquery这样的框架。
确保框架的所有javascript文件可用,或者试试这个:
<button class="button-list-spacing" id="play-game-button" onclick="window.location.replace("gamepage.html?soundon=" + SOUND_ON);">Play!</button>
并使surevthe SOUND_ON变量可用
相关文章:
- 扩展移相器按钮类不工作
- PHP Javascript显示/隐藏按钮不工作
- Facebook登录按钮没有'不能在Firefox上工作
- 为什么不是'这个jQuery汉堡包按钮不工作
- 隐藏uib弹出按钮点击不工作
- Spring WebFlow2 Javascript只在第一个单选按钮上工作
- 带有向下钻取的 Amchart 图表工作正常,但“后退”按钮不起作用
- 按钮不'我不工作;我又回到了起始页
- 主干点击事件按钮不工作
- 为什么不't在iOS上启动按钮下拉工作
- 类似按钮增量计数器不工作.PHP,AJAX,MySQL,javascript
- Hammer.js滑动不会'单击按钮后才能工作
- Sencha Touch使一个简单的按钮工作
- 提交按钮只能在onchange调用输入文本后第二次点击时工作
- JavaScript 按钮不起作用;代码与其他工作按钮相同
- 如何获得内置进度条的工作按钮动画
- Syncfusion grid with angular support:向rowTemplate中添加工作按钮
- Ng-disabled不工作按钮
- 让Select2 Gem与ActiveAdmin一起工作按钮
- 点击isn't工作按钮