您根本不必这样做,这只是为了使访问功能内部的这些更容易。
这 self
当您在jQuery函数中使用回调时,变量很有用, this
将设置为您所采取的元素。例如:
$('.bacon').each(function(){ $(this).css('background', self.getBackground()); });
变量 o
和 el
只能减少打字。如果您有变化 self
, ,或参考 this
不变,您可以访问 options
和 element
直接来自对象的属性。