jquery - Pass parameters to prototype function -


i'm tring modify bootstrap 3 javascript adding new function affix plugin. in particular addded function:

affix.prototype.refresh = function (elem) {   console.log("refresh");   console.log(elem);   this.options.offset.top = elem.offset.top; } 

my question is, witch syntax call function passing elem parameter?

i'm tring this:

$("#_mapdiv").affix("refresh",{offset:{top:100}}); 

but have output in console:

refresh undefined uncaught typeerror: cannot read property 'offset' of undefined  

it should affix.refresh(param).


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -