Reference jQuery plugin options -
Reference jQuery plugin options -
i'm using inifitescroll jquery plugin, , want reference options variable version of locading.start function:
var rdealbone = this; ($('.deals-list'), this.el).infinitescroll({ navselector : "div.navigation", nextselector : "div.navigation a", itemselector : ".deal", debug: true, loading: { finished: undefined, finishedmsg: "<em>congratulations, you've reached end of internet.</em>", img: "http://www.infinite-scroll.com/loading.gif", msg: null, msgtext: "<em>loading next set of posts...</em>", selector: null, speed: 'fast', start: function(){ // code default start function of plugin, // opts refers plugin options cariable, how can refere // function $(opts.navselector).hide(); opts.loading.msg .appendto(opts.loading.selector) .show(opts.loading.speed, function () { rdealbone.showmore(); }); } }, pathparse: function(){ homecoming '/listdeals/offset:' + rdealbone.doffset; } });
how can reference plugin options within start function?
appreciate help, yehia.
looks me if can access them through first param:
opts.loading.start.call($(opts.contentselector)[0],opts);
so you'd do:
start: function (opts) { console.log(opts); }
i've not used plugin before i've not tried myself.
jquery jquery-plugins
Comments
Post a Comment