このようなJQueryウィジェットを作成します
<script type="text/javascript">
(function ($) {
$.widget("cb.bacon", {
_create: function() {
var self = this,
o = self.options,
el = self.element;
// Some code
},
_bacon: function() {
var self = this,
o = self.options,
el = self.element;
// Some code
},
_smokey: function() {
var self = this,
o = self.options,
el = self.element;
// Some code
}
});
})(jQuery);
</script>
作成する関数ごとに、必ずself
, options
,を宣言する必要があります。element
私が欠けているという基本的な理解はありますか、それとも本当に常にそうしなければならないのでしょうか?