Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Slideshow(options) {
- // The defaults, if user didn't provide values
- var defaults = {
- openSpeed : 1000,
- closeSpeed : 1000,
- animationFunction : "linear",
- matt: "bob"
- };
- // Function that takes options as does something with it
- function init(options) {
- console.info(options);
- }
- // Takes user proivded
- function combine_options(options) {
- for ( option in defaults ) {
- if ( typeof options[option] == "undefined" ) {
- options[option] = defaults[option]
- }
- } return options;
- }
- init(combine_options(options));
- }
- var my_slideshow = new Slideshow({
- openSpeed: 2000
- });
Add Comment
Please, Sign In to add comment