ブートストラップ 3 JavaScript を変更して、接辞プラグイン用の新しい機能を追加しようとしています。特に、次の機能を追加しました。
Affix.prototype.refresh = function (elem) {
console.log("refresh");
console.log(elem);
this.options.offset.top = elem.offset.top;
}
私の質問は、魔女は elem パラメータを渡してこの関数を呼び出す構文ですか?
私はこれを試しています:
$("#_mapDiv").affix("refresh",{offset:{top:100}});
しかし、コンソールに次の出力があります。
refresh
undefined
Uncaught TypeError: Cannot read property 'offset' of undefined