为jQuery添加Webkit的触摸的方法分享

2020-05-24 21:29:56易采站长站整理

                                    action.call(this, e);
                                }
                            });
                        }).call(this, false);
                    });


                    return this;
                }
            }
        }
    }
    //Add events into jquery
    for (var eventName in indream.touch.evenList) {
        var event = indream.touch.evenList[eventName];
        $.fn[eventName] = event.eventFunction || (function (eventName, htmlEvent) {
            return function (action) {
                $(this).each(function () {
                    $(this).bind(htmlEvent, action);
                    //Add event listener method for IE or others
                    if (this.attachEvent) {
                        this.attachEvent(‘on’ + htmlEvent, function (e) {
                            $(this).on(eventName);
                        });
                    } else {
                        this.addEventListener(htmlEvent, function (e) {