gpt4 book ai didi

android - ionic 和 cordova - css active 在 android 设备上不工作

转载 作者:搜寻专家 更新时间:2023-11-01 08:42:53 24 4
gpt4 key购买 nike

我在 cordova 平台上使用 ionic 框架。元素(div、按钮或 a) Activity 状态的 css 在开发/测试期间在浏览器中工作正常,但在 android 设备/模拟器中根本不工作

我已经定义了一些类

.bg-dark {
background: #333333 !important;
}

.bg-active-darkBlue:active {
background: #16499a !important;
}

和下面的 html

<a class="fg-white bg-active-darkBlue button" style="background-color:#3B5998;">Sign in with Facebook</a>

甚至尝试过这个(在 ionic 论坛上)

<a ng-mousedown="class='bg-active-darkBlue'" ng-mouseup="class='bg-dark'" menu-close class="fg-white {{class}}">Sign in with Facebook</a>

尝试了 a、div 和 button 标签。仍然不能在 android 上工作,只能在浏览器中工作,请帮助。

最佳答案

根据经验, Angular ng-mousedownng-mouseup事件不会在移动设备上触发。我的经验是 iOS 上的 ionic 1.6.4。

然而,触摸和释放完美无缺。所以只需替换 ng-mousedownng-mouseupon-touchon-release , 分别。

<a on-touch="class='bg-active-darkBlue'" on-release="class='bg-dark'" menu-close class="fg-white {{class}}">Sign in with Facebook</a>

这是 pointeron-touch 上的 ionic 引用文档和 on-release事件。

希望这有帮助..

关于android - ionic 和 cordova - css active 在 android 设备上不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31092592/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com