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

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -