"Object doesn't support this property or method" 在 IE8 中设置对象时 属性

"Object doesn't support this property or method" when setting an object property in IE8

我试图在不使用 jQuery 的情况下制作可拖动元素。我希望它与 IE8 兼容。以下在 this.handle = { 处中断并出现错误 "Object doesn't support this property or method."

IE9< 在设置对象属性时是否有一些愚蠢的问题?

var Draggable = function(el){
  this.el = el;
  this.el.style.left = "0px";
  this.el.style.top = "0px";
  this.origin = {};

  this.handle = {
    drag: this.drag.bind(this),
    move: this.move.bind(this)
  };

  this.events = {
    start: new Listener(this.el, ["mousedown", "touchstart"], this.handle.drag),
    move: {},
    end: {}
  };
}
Draggable.prototype = {
  drag: function(evt){
    this.origin.left = parseInt(this.el.style.left) - evt.clientX;
    this.origin.top = parseInt(this.el.style.top) - evt.clientY;
    this.events.move = new Listener(window, ["mousemove", "touchmove"], this.handle.move);
    this.events.end = new Listener(window, ["mouseup", "touchend"], this.drop.bind(this));
  },
  move: function(evt){
    this.el.style.left = this.origin.left + evt.clientX + "px";
    this.el.style.top = this.origin.top + evt.clientY + "px";
  },
  drop: function(){
    this.events.move.stopListening();
  }
}
IE8 不支持

Function.prototype.bind()。你可以为它写一个polyfill