daily pastebin goal
1%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function Slideshow(options) {
  2.        
  3.         // The defaults, if user didn't provide values
  4.         var defaults = {
  5.             openSpeed : 1000,
  6.             closeSpeed : 1000,
  7.             animationFunction : "linear",
  8.             matt: "bob"
  9.         };
  10.        
  11.         // Function that takes options as does something with it
  12.         function init(options) {
  13.             console.info(options);
  14.         }
  15.        
  16.         // Takes user proivded
  17.         function combine_options(options) {
  18.             for ( option in defaults ) {
  19.                 if ( typeof options[option] == "undefined" ) {
  20.                     options[option] = defaults[option]
  21.                 }
  22.             } return options;
  23.         }
  24.        
  25.         init(combine_options(options));
  26.        
  27.     }
  28.    
  29.     var my_slideshow = new Slideshow({
  30.         openSpeed: 2000
  31.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top