如何以编程方式更改iPhone上的glyphicon元素?

时间:2016-12-31 00:53:37

标签: javascript jquery ios iphone twitter-bootstrap-3

我已经构建了一个获取表单数据的网页。它使用bootstrap来展开和折叠表单的各个部分。折叠和扩展可手动和以编程方式工作。

无法通过事件更改glyphicon。

以下代码适用于桌面,但不适用于iPhone。

$('.collapse').on(
    'shown.bs.collapse', function()
    {
        $(this).parent().find(".glyphicon-triangle-right").removeClass("glyphicon-triangle-right").addClass("glyphicon-triangle-bottom");
    }
).on(
    'hidden.bs.collapse', function()
    {
        $(this).parent().find(".glyphicon-triangle-bottom").removeClass("glyphicon-triangle-bottom").addClass("glyphicon-triangle-right");
    }
);

有没有办法通过iPhone上的Safari上的代码更改glyphicons?

1 个答案:

答案 0 :(得分:0)

事实证明这是一个边缘案例。它适用于iOS Safari的更高版本。