Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){
- var options;
- $.fn.main(opts){
- options = opts;
- //rest of code
- }
- $.fn.otherFunc(){
- //does something with options
- }
- }(jQuery));
- $("#div1, #div2, #div3, #div4, #div5").main(opts);
- var opts1 = {...};
- $("#div1").main(opts1);
- var opts2 = {...};
- $("#div2").main(opts2);
- // etc.
- (function($){
- var options;
- $.fn.main = function(opts){
- options = opts;
- //rest of code
- alert(options.text);
- }
- $.fn.otherFunc = function(){
- //does something with options
- }
- })(jQuery);
- $('a:first').main({text:'txt'});
- $('a:last').main({text:'some other text'});
Add Comment
Please, Sign In to add comment