【问题标题】:Handle touch event on Apple - Highcharts在 Apple 上处理触摸事件 - Highcharts
【发布时间】:2015-10-15 06:27:44
【问题描述】:

我在 iOS 中使用 Highcharts 标签进行触摸事件时遇到问题。

我也通过使用下面的代码启用了在 highcharts 中的标签点击:

point : {
    events : {
        click : function() {
            var resultMatch = $.inArray(this.x,innerIndex);
            var selectedSliceColor = 
            mainPieDataSeries[this.x].graphic.attr('fill');
            handleCategorySelection(this.x, this.y,this.name, 
                                    selectedSliceColor);
        },
        mouseOver : function() {
                    /* functions*/
        }
    }
}

此点击事件在笔记本电脑和除 Apple iPad 之外的其他设备上运行良好。为了让这个活动发挥作用,我必须

长按标签然后点击被触发。

有什么想法我们可以像在 jQuery 中一样在 Highcharts 中处理这个事件吗? 我们必须绑定 touchstart 事件。

.bind(touchstart)

但是如何处理 Highcharts。

【问题讨论】:

    标签: jquery ios highcharts


    【解决方案1】:

    您需要使用custom-events 扩展并捕获"touchstart""touchend" 事件。

    【讨论】:

    • 我应该删除点击并使用 touchstart 还是将相同的方法复制到 touchstart
    • 任何例子都可以
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-10-26
    • 1970-01-01
    • 2014-03-19
    • 2015-02-08
    • 2013-05-09
    • 2015-04-19
    • 1970-01-01
    相关资源
    最近更新 更多