Guest User

Untitled

a guest
Feb 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. (function($){
  2. $.fn.pluginName = function(options){
  3. var settings = {
  4. myFunction : function(){
  5. // If specified will allow the user to override it.
  6. }
  7. };
  8.  
  9. if (options) {
  10. $.extend(settings, options);
  11. }
  12. };
  13. });
  14.  
  15.  
  16. // Will use default
  17. $('selector').pluginName();
  18.  
  19. // Override
  20. $('selector').pluginName({
  21. myFunction : function(){
  22. // overrides default
  23. }
  24. });
Add Comment
Please, Sign In to add comment